aboutsummaryrefslogtreecommitdiff
path: root/lib.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-06-05 12:25:15 +0300
committerArnold D. Robbins <arnold@skeeve.com>2020-06-05 12:25:15 +0300
commit754cf93645ad3a0061bbd434618a667ac6110121 (patch)
tree66ffa0701847685c50924d1020fdd4786ef7dbc5 /lib.c
parent1107437dceb036a21745779d911539cc273bb094 (diff)
downloadone-true-awk-754cf93645ad3a0061bbd434618a667ac6110121.tar.gz
In fldbld(), check that inputFS is set.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 9665244..a98ffee 100644
--- a/lib.c
+++ b/lib.c
@@ -332,6 +332,8 @@ void fldbld(void) /* create fields from current record */
}
fr = fields;
i = 0; /* number of fields accumulated here */
+ if (inputFS == NULL) /* make sure we have a copy of FS */
+ savefs();
if (strlen(inputFS) > 1) { /* it's a regular expression */
i = refldbld(r, inputFS);
} else if ((sep = *inputFS) == ' ') { /* default whitespace */