=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/csplit/csplit.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/csplit/csplit.c 2006/07/17 22:28:11 1.3 +++ src/usr.bin/csplit/csplit.c 2012/03/04 04:05:15 1.4 @@ -1,4 +1,4 @@ -/* $OpenBSD: csplit.c,v 1.3 2006/07/17 22:28:11 deraadt Exp $ */ +/* $OpenBSD: csplit.c,v 1.4 2012/03/04 04:05:15 fgsch Exp $ */ /* $FreeBSD: src/usr.bin/csplit/csplit.c,v 1.9 2004/03/22 11:15:03 tjr Exp $ */ /*- @@ -63,7 +63,7 @@ void cleanup(void); void do_lineno(const char *); void do_rexp(const char *); -char *getline(void); +char *get_line(void); void handlesig(int); FILE *newfile(void); void toomuch(FILE *, long); @@ -195,7 +195,7 @@ /* Copy the rest into a new file. */ if (!feof(infile)) { ofp = newfile(); - while ((p = getline()) != NULL && fputs(p, ofp) == 0) + while ((p = get_line()) != NULL && fputs(p, ofp) == 0) ; if (!sflag) printf("%jd\n", (intmax_t)ftello(ofp)); @@ -270,7 +270,7 @@ /* Read a line from the input into a static buffer. */ char * -getline(void) +get_line(void) { static char lbuf[LINE_MAX]; FILE *src; @@ -291,7 +291,7 @@ return (lbuf); } -/* Conceptually rewind the input (as obtained by getline()) back `n' lines. */ +/* Conceptually rewind the input (as obtained by get_line()) back `n' lines. */ void toomuch(FILE *ofp, long n) { @@ -343,7 +343,7 @@ err(1, "%s", currfile); /* - * getline() will read from here. Next call will truncate to + * get_line() will read from here. Next call will truncate to * truncofs in this file. */ overfile = ofp; @@ -391,7 +391,7 @@ /* Read and output lines until we get a match. */ first = 1; - while ((p = getline()) != NULL) { + while ((p = get_line()) != NULL) { if (fputs(p, ofp) != 0) break; if (!first && regexec(&cre, p, 0, NULL, 0) == 0) @@ -417,7 +417,7 @@ * Positive offset: copy the requested number of lines * after the match. */ - while (--ofs > 0 && (p = getline()) != NULL) + while (--ofs > 0 && (p = get_line()) != NULL) fputs(p, ofp); toomuch(NULL, 0); nwritten = (intmax_t)ftello(ofp); @@ -451,7 +451,7 @@ while (nfiles < maxfiles - 1) { ofp = newfile(); while (lineno + 1 != lastline) { - if ((p = getline()) == NULL) + if ((p = get_line()) == NULL) errx(1, "%ld: out of range", lastline); if (fputs(p, ofp) != 0) break;