diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2012-03-04 04:05:16 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2012-03-04 04:05:16 +0000 |
commit | ea5319421a589ebd8583734a461346e1f0d91bec (patch) | |
tree | f5bd7462d5be00f2b6c3ea91c579bd03d2ef6dce /usr.bin/csplit/csplit.c | |
parent | c90e6f8af6e01b6bd2b8ec8057571ae41b0ddb00 (diff) |
In preparation for getline and getdelim additions to libc, rename getline()
occurrences to get_line().
Based on a diff from Jan Klemkow <j-dot-klemkow-at-wemelug-dot-de> to tech.
Diffstat (limited to 'usr.bin/csplit/csplit.c')
-rw-r--r-- | usr.bin/csplit/csplit.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/csplit/csplit.c b/usr.bin/csplit/csplit.c index e1b3ebcf774..d90c488eb08 100644 --- a/usr.bin/csplit/csplit.c +++ b/usr.bin/csplit/csplit.c @@ -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 @@ main(int argc, char *argv[]) /* 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 @@ cleanup(void) /* 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 @@ again: if (fgets(lbuf, sizeof(lbuf), src) == NULL) { 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 @@ toomuch(FILE *ofp, long n) 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 @@ do_rexp(const char *expr) /* 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 @@ do_rexp(const char *expr) * 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 @@ do_lineno(const char *expr) 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; |