rcp.c (10663) | rcp.c (13978) |
---|---|
1/* 2 * Copyright (c) 1983, 1990, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * | 1/* 2 * Copyright (c) 1983, 1990, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * |
33 * $Id: rcp.c,v 1.4 1995/05/30 00:07:06 rgrimes Exp $ | 33 * $Id: rcp.c,v 1.5 1995/09/10 14:57:48 markm Exp $ |
34 */ 35 36#ifndef lint 37static char copyright[] = 38"@(#) Copyright (c) 1983, 1990, 1992, 1993\n\ 39 The Regents of the University of California. All rights reserved.\n"; 40#endif /* not lint */ 41 --- 545 unchanged lines hidden (view full) --- 587 if (buf[0] == 'E') { 588 (void)write(rem, "", 1); 589 return; 590 } 591 592 if (ch == '\n') 593 *--cp = 0; 594 | 34 */ 35 36#ifndef lint 37static char copyright[] = 38"@(#) Copyright (c) 1983, 1990, 1992, 1993\n\ 39 The Regents of the University of California. All rights reserved.\n"; 40#endif /* not lint */ 41 --- 545 unchanged lines hidden (view full) --- 587 if (buf[0] == 'E') { 588 (void)write(rem, "", 1); 589 return; 590 } 591 592 if (ch == '\n') 593 *--cp = 0; 594 |
595#define getnum(t) (t) = 0; while (isdigit(*cp)) (t) = (t) * 10 + (*cp++ - '0'); | |
596 cp = buf; 597 if (*cp == 'T') { 598 setimes++; 599 cp++; | 595 cp = buf; 596 if (*cp == 'T') { 597 setimes++; 598 cp++; |
600 getnum(mtime.tv_sec); 601 if (*cp++ != ' ') | 599 mtime.tv_sec = strtol(cp, &cp, 10); 600 if (!cp || *cp++ != ' ') |
602 SCREWUP("mtime.sec not delimited"); | 601 SCREWUP("mtime.sec not delimited"); |
603 getnum(mtime.tv_usec); 604 if (*cp++ != ' ') | 602 mtime.tv_usec = strtol(cp, &cp, 10); 603 if (!cp || *cp++ != ' ') |
605 SCREWUP("mtime.usec not delimited"); | 604 SCREWUP("mtime.usec not delimited"); |
606 getnum(atime.tv_sec); 607 if (*cp++ != ' ') | 605 atime.tv_sec = strtol(cp, &cp, 10); 606 if (!cp || *cp++ != ' ') |
608 SCREWUP("atime.sec not delimited"); | 607 SCREWUP("atime.sec not delimited"); |
609 getnum(atime.tv_usec); 610 if (*cp++ != '\0') | 608 atime.tv_usec = strtol(cp, &cp, 10); 609 if (!cp || *cp++ != '\0') |
611 SCREWUP("atime.usec not delimited"); 612 (void)write(rem, "", 1); 613 continue; 614 } 615 if (*cp != 'C' && *cp != 'D') { 616 /* 617 * Check for the case "rcp remote:foo\* local:bar". 618 * In this case, the line "No match." can be returned --- 310 unchanged lines hidden --- | 610 SCREWUP("atime.usec not delimited"); 611 (void)write(rem, "", 1); 612 continue; 613 } 614 if (*cp != 'C' && *cp != 'D') { 615 /* 616 * Check for the case "rcp remote:foo\* local:bar". 617 * In this case, the line "No match." can be returned --- 310 unchanged lines hidden --- |