diff mbox

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

Message ID 86103623-85a1-b940-5f27-3705da6589cb@gigawatt.nl (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show

Commit Message

Harald van Dijk Feb. 24, 2018, 5:22 p.m. UTC
On 2/24/18 5:52 PM, Herbert Xu wrote:
> On Sat, Feb 24, 2018 at 10:47:07AM +0100, Harald van Dijk wrote:
>>
>> It seems like the new control character doesn't get escaped in one place
>> where it should be, and gets lost because of that:
>>
>> Unpatched:
>>
>> $ dash -c 'x=`printf \\\211X`; echo $x | cat -v'
>> M-^IX
>>
>> Patched:
>>
>> $ src/dash -c 'x=`printf \\\211X`; echo $x | cat -v'
>> X
> 
> Hmm, it works here.  Can you check that your Makefile is up-to-date

It was.

> and the generated syntax.c looks like this:
> 
> const char basesyntax[] = {
>        CEOF,    CSPCL,   CWORD,   CCTL,
>        CCTL,    CCTL,    CCTL,    CCTL,
>        CCTL,    CCTL,    CCTL,    CCTL,

Thanks, that was what was wrong. Although mksyntax did get re-executed 
because of your Makefile change, re-executing it didn't help: mksyntax 
doesn't use parser.h at run time, only at build time. So I think the 
Makefile.am change should instead be:


Cheers,
Harald van Dijk

--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -66,7 +66,7 @@  syntax.c syntax.h: mksyntax
  signames.c: mksignames
         ./$^

-mksyntax: token.h
+mksyntax: parser.h token.h

  $(HELPERS): %: %.c
         $(COMPILE_FOR_BUILD) -o $@ $<