ash: fix handling of bashism $'xxx' with high-bit chars. Closes 9236
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 20 Sep 2016 15:04:09 +0000 (17:04 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 20 Sep 2016 15:04:09 +0000 (17:04 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c

index a885514d3f904348c68222f53c7e27586c0accb3..d96e5685163e9e2d58c1ace10f439f807e48a991 100644 (file)
@@ -11229,6 +11229,9 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
                                c = decode_dollar_squote();
                                if (c & 0x100) {
                                        USTPUTC('\\', out);
+                                       if (eofmark == NULL || dblquote)
+                                               /* Or else this SEGVs: $'\<0x82>' */
+                                               USTPUTC(CTLESC, out);
                                        c = (unsigned char)c;
                                }
                        }