diff options
author | Jim Meyering <jim@meyering.net> | 1998-06-29 15:57:45 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-06-29 15:57:45 +0000 |
commit | 257c5c4737ce0399316199903ae402ae9e794a84 (patch) | |
tree | 649dc55a3e71f5f0cc99fa9b3cb1bfe460536e38 /src/cut.c | |
parent | 391c960cba3d7207149f5148d99c068331add803 (diff) | |
download | coreutils-257c5c4737ce0399316199903ae402ae9e794a84.tar.gz coreutils-257c5c4737ce0399316199903ae402ae9e794a84.tar.bz2 coreutils-257c5c4737ce0399316199903ae402ae9e794a84.zip |
revert back to using lower case _unlocked wrapper names
Diffstat (limited to 'src/cut.c')
-rw-r--r-- | src/cut.c | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -254,7 +254,7 @@ getstr (char **lineptr, int *n, FILE *stream, char terminator) for (;;) { - register int c = GETC (stream); + register int c = getc (stream); /* We always want at least one char left in the buffer, since we always (unless we get an error while reading the first char) @@ -276,7 +276,7 @@ getstr (char **lineptr, int *n, FILE *stream, char terminator) assert (*n - nchars_avail == read_pos - *lineptr); } - if (FEOF (stream) || ferror (stream)) + if (feof (stream) || ferror (stream)) { /* Return partial line, if any. */ if (read_pos == *lineptr) @@ -484,17 +484,17 @@ cut_bytes (FILE *stream) { register int c; /* Each character from the file. */ - c = GETC (stream); + c = getc (stream); if (c == '\n') { - PUTCHAR ('\n'); + putchar ('\n'); byte_idx = 0; } else if (c == EOF) { if (byte_idx > 0) - PUTCHAR ('\n'); + putchar ('\n'); break; } else @@ -502,7 +502,7 @@ cut_bytes (FILE *stream) ++byte_idx; if (print_kth (byte_idx)) { - PUTCHAR (c); + putchar (c); } } } @@ -522,7 +522,7 @@ cut_fields (FILE *stream) found_any_selected_field = 0; field_idx = 1; - c = GETC (stream); + c = getc (stream); empty_input = (c == EOF); if (c != EOF) ungetc (c, stream); @@ -558,17 +558,17 @@ cut_fields (FILE *stream) } else { - FWRITE (field_1_buffer, sizeof (char), len, stdout); + fwrite (field_1_buffer, sizeof (char), len, stdout); /* Make sure the output line is newline terminated. */ if (field_1_buffer[len - 1] != '\n') - PUTCHAR ('\n'); + putchar ('\n'); } continue; } if (print_kth (1)) { /* Print the field, but not the trailing delimiter. */ - FWRITE (field_1_buffer, sizeof (char), len - 1, stdout); + fwrite (field_1_buffer, sizeof (char), len - 1, stdout); found_any_selected_field = 1; } ++field_idx; @@ -581,18 +581,18 @@ cut_fields (FILE *stream) if (found_any_selected_field) { /* FIXME: use output delimiter here */ - PUTCHAR (delim); + putchar (delim); } found_any_selected_field = 1; - while ((c = GETC (stream)) != delim && c != '\n' && c != EOF) + while ((c = getc (stream)) != delim && c != '\n' && c != EOF) { - PUTCHAR (c); + putchar (c); } } else { - while ((c = GETC (stream)) != delim && c != '\n' && c != EOF) + while ((c = getc (stream)) != delim && c != '\n' && c != EOF) { /* Empty. */ } @@ -601,7 +601,7 @@ cut_fields (FILE *stream) if (c == '\n') { - c = GETC (stream); + c = getc (stream); if (c != EOF) { ungetc (c, stream); @@ -615,7 +615,7 @@ cut_fields (FILE *stream) { if (found_any_selected_field || (!empty_input && !(suppress_non_delimited && field_idx == 1))) - PUTCHAR ('\n'); + putchar ('\n'); if (c == EOF) break; field_idx = 1; @@ -658,14 +658,14 @@ cut_file (char *file) cut_stream (stream); - if (FERROR (stream)) + if (ferror (stream)) { error (0, errno, "%s", file); return 1; } if (STREQ (file, "-")) - CLEARERR (stream); /* Also clear EOF. */ - else if (FCLOSE (stream) == EOF) + clearerr (stream); /* Also clear EOF. */ + else if (fclose (stream) == EOF) { error (0, errno, "%s", file); return 1; @@ -765,12 +765,12 @@ main (int argc, char **argv) for (; optind < argc; optind++) exit_status |= cut_file (argv[optind]); - if (have_read_stdin && FCLOSE (stdin) == EOF) + if (have_read_stdin && fclose (stdin) == EOF) { error (0, errno, "-"); exit_status = 1; } - if (FERROR (stdout) || fclose (stdout) == EOF) + if (ferror (stdout) || fclose (stdout) == EOF) error (EXIT_FAILURE, errno, _("write error")); exit (exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE); |