diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-08-02 20:39:01 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-08-02 20:39:01 +0300 |
commit | 48f02e6672003d218d4c0348a6add7931522603b (patch) | |
tree | 052246fdd311d0bcd540a5ab3c41187a7065a971 /main.c | |
parent | 39a49e9e54b19cc8a51f8f6030bef65d7adf952f (diff) | |
parent | 3998ed059bbcfc189cd0d6c5762913fbd4ff4e77 (diff) | |
download | egawk-48f02e6672003d218d4c0348a6add7931522603b.tar.gz egawk-48f02e6672003d218d4c0348a6add7931522603b.tar.bz2 egawk-48f02e6672003d218d4c0348a6add7931522603b.zip |
Merge branch 'gawk-4.2-stable'
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1165,11 +1165,18 @@ arg_assign(char *arg, bool initing) fatal(_("cannot use function `%s' as variable name"), arg); } + // POSIX disallows any newlines inside strings + // The scanner handles that for program files. + // We have to check here for strings passed to -v. + if (do_posix && strchr(cp, '\n') != NULL) + fatal(_("POSIX does not allow physical newlines in string values")); + /* * BWK awk expands escapes inside assignments. * This makes sense, so we do it too. + * In addition, remove \-<newline> as in scanning. */ - it = make_str_node(cp, strlen(cp), SCAN); + it = make_str_node(cp, strlen(cp), SCAN | ELIDE_BACK_NL); it->flags |= USER_INPUT; #ifdef LC_NUMERIC /* |