diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | scp.c | 25 |
2 files changed, 15 insertions, 15 deletions
@@ -12,6 +12,9 @@ | |||
12 | - stevesk@cvs.openbsd.org 2001/04/14 16:33:20 | 12 | - stevesk@cvs.openbsd.org 2001/04/14 16:33:20 |
13 | [clientloop.c packet.h session.c ssh.c ttymodes.c ttymodes.h] | 13 | [clientloop.c packet.h session.c ssh.c ttymodes.c ttymodes.h] |
14 | protocol 2 tty modes support; ok markus@ | 14 | protocol 2 tty modes support; ok markus@ |
15 | - stevesk@cvs.openbsd.org 2001/04/14 17:04:42 | ||
16 | [scp.c] | ||
17 | 'T' handling rcp/scp sync; ok markus@ | ||
15 | 18 | ||
16 | 20010414 | 19 | 20010414 |
17 | - Sync with OpenBSD glob.c, strlcat.c and vis.c changes | 20 | - Sync with OpenBSD glob.c, strlcat.c and vis.c changes |
@@ -5078,4 +5081,4 @@ | |||
5078 | - Wrote replacements for strlcpy and mkdtemp | 5081 | - Wrote replacements for strlcpy and mkdtemp |
5079 | - Released 1.0pre1 | 5082 | - Released 1.0pre1 |
5080 | 5083 | ||
5081 | $Id: ChangeLog,v 1.1114 2001/04/14 23:13:02 mouring Exp $ | 5084 | $Id: ChangeLog,v 1.1115 2001/04/14 23:14:22 mouring Exp $ |
@@ -75,7 +75,7 @@ | |||
75 | */ | 75 | */ |
76 | 76 | ||
77 | #include "includes.h" | 77 | #include "includes.h" |
78 | RCSID("$OpenBSD: scp.c,v 1.65 2001/04/06 16:46:59 deraadt Exp $"); | 78 | RCSID("$OpenBSD: scp.c,v 1.66 2001/04/14 17:04:42 stevesk Exp $"); |
79 | 79 | ||
80 | #include "xmalloc.h" | 80 | #include "xmalloc.h" |
81 | #include "atomicio.h" | 81 | #include "atomicio.h" |
@@ -677,9 +677,10 @@ sink(argc, argv) | |||
677 | off_t size; | 677 | off_t size; |
678 | int setimes, targisdir, wrerrno = 0; | 678 | int setimes, targisdir, wrerrno = 0; |
679 | char ch, *cp, *np, *targ, *why, *vect[1], buf[2048]; | 679 | char ch, *cp, *np, *targ, *why, *vect[1], buf[2048]; |
680 | int dummy_usec; | ||
681 | struct timeval tv[2]; | 680 | struct timeval tv[2]; |
682 | 681 | ||
682 | #define atime tv[0] | ||
683 | #define mtime tv[1] | ||
683 | #define SCREWUP(str) { why = str; goto screwup; } | 684 | #define SCREWUP(str) { why = str; goto screwup; } |
684 | 685 | ||
685 | setimes = targisdir = 0; | 686 | setimes = targisdir = 0; |
@@ -726,25 +727,21 @@ sink(argc, argv) | |||
726 | if (ch == '\n') | 727 | if (ch == '\n') |
727 | *--cp = 0; | 728 | *--cp = 0; |
728 | 729 | ||
729 | #define getnum(t) (t) = 0; \ | ||
730 | while (*cp >= '0' && *cp <= '9') (t) = (t) * 10 + (*cp++ - '0'); | ||
731 | cp = buf; | 730 | cp = buf; |
732 | if (*cp == 'T') { | 731 | if (*cp == 'T') { |
733 | setimes++; | 732 | setimes++; |
734 | cp++; | 733 | cp++; |
735 | getnum(tv[1].tv_sec); | 734 | mtime.tv_sec = strtol(cp, &cp, 10); |
736 | if (*cp++ != ' ') | 735 | if (!cp || *cp++ != ' ') |
737 | SCREWUP("mtime.sec not delimited"); | 736 | SCREWUP("mtime.sec not delimited"); |
738 | getnum(dummy_usec); | 737 | mtime.tv_usec = strtol(cp, &cp, 10); |
739 | tv[1].tv_usec = 0; | 738 | if (!cp || *cp++ != ' ') |
740 | if (*cp++ != ' ') | ||
741 | SCREWUP("mtime.usec not delimited"); | 739 | SCREWUP("mtime.usec not delimited"); |
742 | getnum(tv[0].tv_sec); | 740 | atime.tv_sec = strtol(cp, &cp, 10); |
743 | if (*cp++ != ' ') | 741 | if (!cp || *cp++ != ' ') |
744 | SCREWUP("atime.sec not delimited"); | 742 | SCREWUP("atime.sec not delimited"); |
745 | getnum(dummy_usec); | 743 | atime.tv_usec = strtol(cp, &cp, 10); |
746 | tv[0].tv_usec = 0; | 744 | if (!cp || *cp++ != '\0') |
747 | if (*cp++ != '\0') | ||
748 | SCREWUP("atime.usec not delimited"); | 745 | SCREWUP("atime.usec not delimited"); |
749 | (void) atomicio(write, remout, "", 1); | 746 | (void) atomicio(write, remout, "", 1); |
750 | continue; | 747 | continue; |