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

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

 



On Mon, Apr 2, 2018 at 7:08 PM, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, Apr 02, 2018 at 03:48:46PM +0200, Denys Vlasenko wrote:
>>
>> Another probably buggy case:
>>
>> cat <<EOF
>> -\t-\\-\"-\'-\`-\--\z-\*-\?-
>> `echo  '-\t-\\-\"-\x-\`-\--\z-\*-\?-'`
>> $(echo '-\t-\\-\"-\x-\`-\--\z-\*-\?-')
>> EOF
>>
>>
>> # bash heredoc_backslash.test
>> -\t-\-\"-\'-`-\--\z-\*-\?-
>> -\t-\-\"-\x-`-\--\z-\*-\?-
>> -\t-\\-\"-\x-\`-\--\z-\*-\?-
>>
>> # dash heredoc_backslash.test
>> -\t-\-\"-\'-`-\--\z-\*-\?-
>> -    -\-"-\x-`-\--\z-\*-\?-
>> -    -\-\"-\x-\`-\--\z-\*-\?-
>>
>> (Second and third line have \t expanded to tab. Mail-mangled to spaces, likely)
>>
>> Apart from \t, note that in second heredoc line there is a difference in how
>> `echo  '\"'` was handled: bash prints \", dash prints ".
>
> FWIW ksh93 does the same thing.


Building and launching current git...

sh-4.3$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
sh-4.3$ git pull
Already up to date.
sh-4.3$ make
make  all-recursive
...
make[2]: Leaving directory '/home/srcdevel/bbox/fix/dash-T'
make[1]: Leaving directory '/home/srcdevel/bbox/fix/dash-T'
sh-3.4$ src/dash

I see this:

$ x='\t'; echo "[$x]"
[    ]

I'm pretty sure this isn't okay...
--
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