Module Name: src
Committed By: ad
Date: Fri Apr 17 22:35:18 UTC 2020
Modified Files:
src/external/historical/nawk/dist: lib.c
Log Message:
Now that inputFS is dynamically allocated, make sure it's always non-NULL.
Fixes core dumps when building CDE.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/historical/nawk/dist/lib.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/historical/nawk/dist/lib.c
diff -u src/external/historical/nawk/dist/lib.c:1.11 src/external/historical/nawk/dist/lib.c:1.12
--- src/external/historical/nawk/dist/lib.c:1.11 Thu Feb 20 19:59:12 2020
+++ src/external/historical/nawk/dist/lib.c Fri Apr 17 22:35:18 2020
@@ -48,7 +48,7 @@ int fieldssize = RECSIZE;
Cell **fldtab; /* pointers to Cells */
static size_t len_inputFS = 0;
-static char *inputFS = NULL; /* FS at time of input, for field splitting */
+static char *inputFS; /* FS at time of input, for field splitting */
#define MAXFLD 2
int nfields = MAXFLD; /* last allocated slot for $i */
@@ -75,6 +75,7 @@ void recinit(unsigned int n)
fldtab[0]->sval = record;
fldtab[0]->nval = tostring("0");
makefields(1, nfields);
+ inputFS = strdup("");
}
void makefields(int n1, int n2) /* create $n1..$n2 inclusive */