From ce211fb7fcf1463619d2b2ef32b8f6c2f4f35459 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 30 May 2016 17:35:37 -0400 Subject: Allow FS = "\0" if RS = "". --- field.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'field.c') diff --git a/field.c b/field.c index abd08c08..5f5b2b65 100644 --- a/field.c +++ b/field.c @@ -1270,8 +1270,12 @@ choose_fs_function: } else if (fs->stptr[0] == '\\') { /* yet another special case */ strcpy(buf, "[\\\\\n]"); - } else if (fs->stptr[0] != '\n') + } else if (fs->stptr[0] == '\0') { + /* and yet another special case */ + strcpy(buf, "[\\000\n]"); + } else if (fs->stptr[0] != '\n') { sprintf(buf, "[%c\n]", fs->stptr[0]); + } } } else { if (do_posix) -- cgit v1.2.3