diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-06-15 21:50:45 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-06-15 21:50:45 +0300 |
commit | f4bbf63a287cd73f4eb989539e4813a428bf05ad (patch) | |
tree | 313b4a799a7b58b6bfedbee30be9d0419c748aed /builtin.c | |
parent | 5826beec258141776469c5fd9b703d52c81a35fb (diff) | |
parent | ddb62efafb5659dae532089af83350f066446424 (diff) | |
download | egawk-f4bbf63a287cd73f4eb989539e4813a428bf05ad.tar.gz egawk-f4bbf63a287cd73f4eb989539e4813a428bf05ad.tar.bz2 egawk-f4bbf63a287cd73f4eb989539e4813a428bf05ad.zip |
Merge branch 'master' into feature/fixtype
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -2956,8 +2956,10 @@ do_sub(int nargs, unsigned int flags) leave alone, it goes into the output */ } else { /* gawk default behavior since 1996 */ - if (strncmp(scan, "\\\\\\&", 4) == 0) { + if (strncmp(scan, "\\\\\\&", 4) == 0 + || strncmp(scan, "\\\\\\\\", 4) == 0) { /* 2016: fixed */ /* \\\& --> \& */ + /* \\\\ --> \\ */ repllen -= 2; scan += 3; } else if (strncmp(scan, "\\\\&", 3) == 0) { @@ -3070,10 +3072,12 @@ do_sub(int nargs, unsigned int flags) *bp++ = *scan; } else { /* gawk default behavior since 1996 */ - if (strncmp(scan, "\\\\\\&", 4) == 0) { + if (strncmp(scan, "\\\\\\&", 4) == 0 + || strncmp(scan, "\\\\\\\\", 4) == 0) { /* 2016: fixed */ /* \\\& --> \& */ + /* \\\\ --> \\ */ *bp++ = '\\'; - *bp++ = '&'; + *bp++ = scan[3]; scan += 3; } else if (strncmp(scan, "\\\\&", 3) == 0) { /* \\& --> \<string> */ |