diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1994-05-07 18:14:43 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1994-05-07 18:14:43 +0000 |
| commit | 8d29233fea7a22a18c2998c2eb07dec0f26c4101 (patch) | |
| tree | ae7a62b3e6b9d3c5b40e295b8b73feb61e4b04ce /gnu/libexec/uucp/libuucp/parse.c | |
| parent | dbdb1f56bb2d2ff97b05ccbc31ca474727b5d2d7 (diff) | |
Notes
Diffstat (limited to 'gnu/libexec/uucp/libuucp/parse.c')
| -rw-r--r-- | gnu/libexec/uucp/libuucp/parse.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gnu/libexec/uucp/libuucp/parse.c b/gnu/libexec/uucp/libuucp/parse.c index 6b928a4eed4f..d40da8086b66 100644 --- a/gnu/libexec/uucp/libuucp/parse.c +++ b/gnu/libexec/uucp/libuucp/parse.c @@ -1,7 +1,7 @@ /* parse.c Parse a UUCP command string. - Copyright (C) 1991, 1992 Ian Lance Taylor + Copyright (C) 1991, 1992, 1993 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -20,13 +20,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author of the program may be contacted at ian@airs.com or - c/o Infinity Development Systems, P.O. Box 520, Waltham, MA 02254. + c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. */ #include "uucp.h" #if USE_RCS_ID -const char parse_rcsid[] = "$Id: parse.c,v 1.1 1993/08/04 19:35:49 jtc Exp $"; +const char parse_rcsid[] = "$Id: parse.c,v 1.6 1994/03/26 04:42:39 ian Rel $"; #endif #include "uudefs.h" @@ -59,6 +59,7 @@ fparse_cmd (zcmd, qcmd) && qcmd->bcmd != 'P') return FALSE; + qcmd->bgrade = '\0'; qcmd->pseq = NULL; qcmd->zfrom = NULL; qcmd->zto = NULL; @@ -164,10 +165,21 @@ fparse_cmd (zcmd, qcmd) z = strtok ((char *) NULL, " \t\n"); if (z == NULL) return FALSE; - qcmd->imode = (int) strtol (z, &zend, 8); + qcmd->imode = (int) strtol (z, &zend, 0); if (*zend != '\0') return FALSE; + /* As a magic special case, if the mode came out as the decimal + values 666 or 777, assume that they actually meant the octal + values. Most systems use a leading zero, but a few do not. + Since both 666 and 777 are greater than the largest legal mode + value, which is 0777 == 511, this hack does not restrict any + legal values. */ + if (qcmd->imode == 666) + qcmd->imode = 0666; + else if (qcmd->imode == 777) + qcmd->imode = 0777; + z = strtok ((char *) NULL, " \t\n"); if (qcmd->bcmd == 'E' && z == NULL) return FALSE; |
