diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-01-11 22:58:58 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-01-11 22:58:58 +0100 |
commit | 7b9b7f595e3e707d7597e1c0da22b1f6cd95dc6c (patch) | |
tree | d6fcc838b9fc183e432c5a0263ae931494e6d2a5 | |
parent | f0b43c611e9d33f57fcc7abd8f49132fc3cd7d95 (diff) |
Change delim for zflag
-rw-r--r-- | grab.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -64,9 +64,8 @@ static struct ops comppat(char *); static bool xisspace(char); static char *xstrchrnul(const char *, char); -static char delim = '\n'; static int rv = EXIT_SUCCESS; -static bool nflag; +static bool nflag, zflag; static const cmd_func op_table[UCHAR_MAX] = { ['g'] = cmdg, @@ -116,7 +115,7 @@ main(int argc, char **argv) nflag = true; break; case 'z': - delim = '\0'; + zflag = true; break; default: usage(argv[0]); @@ -320,7 +319,7 @@ void putsv(struct sv sv) { fwrite(sv.p, 1, sv.len, stdout); - putchar(delim); + putchar(zflag ? '\0' : '\n'); } regex_t |