Skip to content

Commit 0a91579

Browse files
author
manojampalam
committed
Temporary fixes to scp.exe and sftp.exe to work if started from any directory. Currently they only work if started from their root directory
1 parent 74db643 commit 0a91579

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

scp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3082,6 +3082,10 @@ int start_process_io(char *exename, char **argv, char **envv,
30823082

30833083
ctr = 0;
30843084
cmdbuf[0] = '\0';
3085+
if (argv[0][0] != '\0' && argv[0][1] != ':') {
3086+
strcat(cmdbuf, w32_programdir());
3087+
strcat(cmdbuf, "\\");
3088+
}
30853089
while (argv[ctr]) {
30863090
strcat_s(cmdbuf, sizeof(cmdbuf), argv[ctr]);
30873091
strcat_s(cmdbuf, sizeof(cmdbuf), " ");

sftp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,6 +2219,11 @@ connect_to_server(char *path, char **args, int *in, int *out)
22192219
STARTUPINFO si = { 0 };
22202220

22212221
debug3("Generating ssh-client command...");
2222+
fullCmd[0] = '\0';
2223+
if (path[0] != '\0' && path[1] != ':') {
2224+
strncat(fullCmd, w32_programdir(), MAX_PATH);
2225+
strncat(fullCmd, "\\", MAX_PATH);
2226+
}
22222227
strncat(fullCmd, path, MAX_PATH);
22232228
for (i = 1; args[i]; i++)
22242229
{

0 commit comments

Comments
 (0)