diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 |
commit | 76b5366091f76c9bc73570149ef5055648fc2c39 (patch) | |
tree | 590d020e0f2a5bea6e09d66d951a674443b21d67 /usr.bin/sed/main.c | |
parent | 4b4d01da6f07f7754ff6a6e4f5223e9f0984d1a6 (diff) |
Notes
Diffstat (limited to 'usr.bin/sed/main.c')
-rw-r--r-- | usr.bin/sed/main.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c index 353dedbc8e3d..6e1ef35c6916 100644 --- a/usr.bin/sed/main.c +++ b/usr.bin/sed/main.c @@ -46,7 +46,7 @@ static const char copyright[] = static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94"; #endif static const char rcsid[] = - "$Id: main.c,v 1.7 1997/08/11 07:21:03 charnier Exp $"; + "$Id$"; #endif /* not lint */ #include <sys/types.h> @@ -176,10 +176,9 @@ usage() * together. Empty strings and files are ignored. */ char * -cu_fgets(buf, n, more) +cu_fgets(buf, n) char *buf; int n; - int *more; { static enum {ST_EOF, ST_FILE, ST_STRING} state = ST_EOF; static FILE *f; /* Current open file */ @@ -190,11 +189,8 @@ cu_fgets(buf, n, more) again: switch (state) { case ST_EOF: - if (script == NULL) { - if (more != NULL) - *more = 0; + if (script == NULL) return (NULL); - } linenum = 0; switch (script->type) { case CU_FILE: @@ -219,8 +215,6 @@ again: linenum++; if (linenum == 1 && buf[0] == '#' && buf[1] == 'n') nflag = 1; - if (more != NULL) - *more = !feof(f); return (p); } script = script->next; @@ -235,8 +229,6 @@ again: if (n-- <= 1) { *p = '\0'; linenum++; - if (more != NULL) - *more = 1; return (buf); } switch (*s) { @@ -249,8 +241,6 @@ again: script = script->next; *p = '\0'; linenum++; - if (more != NULL) - *more = 0; return (buf); } case '\n': @@ -258,8 +248,6 @@ again: *p = '\0'; s++; linenum++; - if (more != NULL) - *more = 0; return (buf); default: *p++ = *s++; |