From 0bf7cb7815a8ae15b190312ef76a7be8d5cfe089 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 27 Oct 2009 23:08:16 +0000 Subject: [PATCH] Add a getc_unlocked() variant to zzcat. --- test/zzcat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/zzcat.c b/test/zzcat.c index 7db99ac..bf39cda 100644 --- a/test/zzcat.c +++ b/test/zzcat.c @@ -113,12 +113,14 @@ int main(int argc, char *argv[]) fclose(stream); break; #if defined HAVE_GETLINE - case 23: /* getline() calls */ + case 23: /* getline() and getc() calls */ + case 24: /* getline() and getc_unlocked() calls */ stream = fopen(name, "r"); if(!stream) return EXIT_FAILURE; i = 0; - while ((c = getc(stream)) != EOF) + while ((c = (atoi(argv[1]) == 23) ? getc(stream) + : getc_unlocked(stream)) != EOF) { char *line; ssize_t ret;