aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-06-14 21:30:50 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-06-14 21:30:50 +0300
commit92edf3d8864ca092c9cffb7e1211e38ef7556be5 (patch)
tree8c9de16a939fc069a339c5ddfd9c0b4802637bd3 /builtin.c
parent68773e1444b7e353346e52756e9db8fb487b56d4 (diff)
parentb5a63ab37a2d018b0ae08abbf76ee2e88c3aff4c (diff)
downloadegawk-92edf3d8864ca092c9cffb7e1211e38ef7556be5.tar.gz
egawk-92edf3d8864ca092c9cffb7e1211e38ef7556be5.tar.bz2
egawk-92edf3d8864ca092c9cffb7e1211e38ef7556be5.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin.c b/builtin.c
index 285b442b..888fa10c 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2973,8 +2973,10 @@ set_how_many:
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) {
@@ -3087,10 +3089,12 @@ set_how_many:
*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> */