dash bug: double-quoted "\" breaks glob protection for next char

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$ >'\zzzz'
$ >'\wwww'
$ dash -c 'echo "\*"'
\wwww \zzzz

The cause: uses "\\*" pattern instead of "\\\*".
The fix:

                        /* backslash */
                        case CBACK:
                                c = pgetc2();
                                if (c == PEOF) {
                                        USTPUTC(CTLESC, out);
                                        USTPUTC('\\', out);
                                        pungetc();
                                } else if (c == '\n') {
                                        nlprompt();
                                } else {
                                        if (
                                                dblquote &&
                                                c != '\\' && c != '`' &&
                                                c != '$' && (
                                                        c != '"' ||
                                                        eofmark != NULL
                                                )
                                        ) {
USTPUTC(CTLESC, out); // add this line
                                                USTPUTC('\\', out);
                                        }
                                        USTPUTC(CTLESC, out);
                                        USTPUTC(c, out);
                                        quotef++;
                                }
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux