Re: Bug in Dash's unquoting of backslashes within backquoted strings

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

 



Matt Whitlock wrote:
>A minimal example:
>
>: `: "\\\\
>\\$(bug)"`

>However, when it appears inside a backquoted subcommand (with the 
>backslash characters being appropriately escaped), such as given at the top 
>of this report, then Dash processes it incorrectly:
>
>/bin/sh: 1: bug: not found

This seems to have been introduced by commit 6bbc71d (parser: use
pgetc_eatbnl() in more places).  Reverting the following part of the
commit makes the problem go away:

            case '\\':
-                                if ((pc = pgetc()) == '\n') {
-                   nlprompt();
-                   /*
-                    * If eating a newline, avoid putting
-                    * the newline into the new character
-                    * stream (via the STPUTC after the
-                    * switch).
-                    */
-                   continue;
-               }
+                                pc = pgetc_eatbnl();

Ron



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

  Powered by Linux