diff --git a/contrib/win32/openssh/Win32-OpenSSH.VC.db b/contrib/win32/openssh/Win32-OpenSSH.VC.db index dd65f7d..4fda7fc 100644 Binary files a/contrib/win32/openssh/Win32-OpenSSH.VC.db and b/contrib/win32/openssh/Win32-OpenSSH.VC.db differ diff --git a/contrib/win32/openssh/config.h.vs b/contrib/win32/openssh/config.h.vs index b6cb81c..38b38a8 100644 --- a/contrib/win32/openssh/config.h.vs +++ b/contrib/win32/openssh/config.h.vs @@ -1728,6 +1728,6 @@ typedef long ssize_t; #define HAVE_MBLEN 1 #define SSHDIR "." -#define _PATH_SFTP_SERVER "./sftp-server.exe" -#define _PATH_SSH_PROGRAM "./ssh.exe" +#define _PATH_SFTP_SERVER "sftp-server.exe" +#define _PATH_SSH_PROGRAM "ssh.exe" #define _PATH_LS "dir" diff --git a/progressmeter.c b/progressmeter.c index b632d5f..00bef4e 100644 --- a/progressmeter.c +++ b/progressmeter.c @@ -78,6 +78,10 @@ static volatile sig_atomic_t win_resized; /* for window resizing */ /* units for format_size */ static const char unit[] = " KMGT"; +#ifdef WINDOWS +extern int ScreenX; +#endif + static int can_output(void) { diff --git a/scp.c b/scp.c index 692e017..b9110d6 100644 --- a/scp.c +++ b/scp.c @@ -850,6 +850,7 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout) *fdin = _open_osfhandle((intptr_t)hstdout[0],0); _setmode (*fdin, O_BINARY); // set this file handle for binary I/O + w32_allocate_fd_for_handle(hstdout[0], FALSE); rc = CreateOverlappedPipe( &hstdin[0], &hstdin[1], &sa, 0 ) ; /* write to this fd to get data into ssh.exe*/ @@ -865,6 +866,7 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout) *fdout = _open_osfhandle((intptr_t)hstdin[1],0); _setmode (*fdout, O_BINARY); // set this file handle for binary I/O + w32_allocate_fd_for_handle(hstdin[1], FALSE); hSaveStdout = GetStdHandle(STD_OUTPUT_HANDLE); //hSaveStderr = GetStdHandle(STD_ERROR_HANDLE); @@ -1067,6 +1069,10 @@ main(int argc, char **argv) extern char *optarg; extern int optind; +#ifdef WINDOWS + ConInit(STD_OUTPUT_HANDLE, TRUE); +#endif + /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ sanitise_stdfd(); @@ -1450,7 +1456,7 @@ source(int argc, char **argv) off_t i, statbytes; size_t amt, nr; int fd = -1, haderr, indx; - char *last, *name, buf[2048], encname[PATH_MAX]; + char *last, *lastf, *lastr, *name, buf[2048], encname[PATH_MAX]; int len; for (indx = 0; indx < argc; ++indx) { @@ -1487,10 +1493,15 @@ syserr: run_err("%s: %s", name, strerror(errno)); run_err("%s: not a regular file", name); goto next; } - if ((last = strrchr(name, '/')) == NULL) + if ((lastf = strrchr(name, '/')) == NULL && (lastr = strrchr(name, '\\')) == NULL) last = name; - else - ++last; + else { + if (lastf) + last = lastf; + if (lastr) + last = lastr; + ++last; + } curfile = last; if (pflag) { if (do_times(remout, verbose_mode, &stb) < 0) @@ -2149,7 +2160,7 @@ int start_process_io(char *exename, char **argv, char **envv, ctr++; } - ret = CreateProcess( + ret = CreateProcess( exename, // given in form like "d:\\util\\cmd.exe" cmdbuf, /* in "arg0 arg1 arg2" form command line */ NULL, /* process security */ diff --git a/sftp.c b/sftp.c index b72704d..de63370 100644 --- a/sftp.c +++ b/sftp.c @@ -76,7 +76,6 @@ typedef void EditLine; #ifdef WIN32_VS #include "win32_dirent.h" -extern int ScreenX; #endif /* File to read commands from */ @@ -817,8 +816,7 @@ do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag) m += strlen(tmp); free(tmp); #ifdef WINDOWS - ConSetScreenX(); - width = ScreenX ; + width = ConScreenSizeX(); #else if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1) width = ws.ws_col; @@ -941,8 +939,7 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, } #ifdef WINDOWS - ConSetScreenX(); - width = ScreenX; + width = ConScreenSizeX(); #else if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1) width = ws.ws_col;