aboutsummaryrefslogtreecommitdiffstats
path: root/field.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-05-30 17:35:37 -0400
committerArnold D. Robbins <arnold@skeeve.com>2016-05-30 17:35:37 -0400
commitce211fb7fcf1463619d2b2ef32b8f6c2f4f35459 (patch)
treed835cda9fece2f754accb20f3879e75439f28d31 /field.c
parentdb17f0d20a03bd851e8e4f005eb6304ad6a93c12 (diff)
downloadegawk-ce211fb7fcf1463619d2b2ef32b8f6c2f4f35459.tar.gz
egawk-ce211fb7fcf1463619d2b2ef32b8f6c2f4f35459.tar.bz2
egawk-ce211fb7fcf1463619d2b2ef32b8f6c2f4f35459.zip
Allow FS = "\0" if RS = "".
Diffstat (limited to 'field.c')
-rw-r--r--field.c6
1 files changed, 5 insertions, 1 deletions
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)