Skip to content

Commit 6e9b420

Browse files
committed
Fix #ifdef for WINDOWS
1 parent e3ad6f1 commit 6e9b420

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,7 @@ syserr: run_err("%s: %s", name, strerror(errno));
15471547
run_err("%s: not a regular file", name);
15481548
goto next;
15491549
}
1550+
#ifdef WINDOWS
15501551
if ((lastf = strrchr(name, '/')) == NULL && (lastr = strrchr(name, '\\')) == NULL)
15511552
last = name;
15521553
else {
@@ -1556,6 +1557,12 @@ syserr: run_err("%s: %s", name, strerror(errno));
15561557
last = lastr;
15571558
++last;
15581559
}
1560+
#else
1561+
if ((last = strrchr(name, '/')) == NULL)
1562+
last = name;
1563+
else
1564+
++last;
1565+
#endif
15591566
curfile = last;
15601567
if (pflag) {
15611568
if (do_times(remout, verbose_mode, &stb) < 0)

0 commit comments

Comments
 (0)