Re: [BUG] 'case' does not match double-quoted backslash

2018-02-14 Thread Martijn Dekker
Op 13-02-18 om 14:44 schreef Denys Vlasenko: > Fixed in git, thanks. As already signaled on the dash list, this introduces a new bug: $ ./ash -c 'foo=a; echo "<${foo#[a\]]}>"' Expected output: <> - M. ___ busybox mailing list busybox@busybox.net

Re: [BUG] 'case' does not match double-quoted backslash

2018-02-13 Thread Denys Vlasenko
Fixed in git, thanks. On Tue, Feb 13, 2018 at 11:42 AM, Martijn Dekker wrote: > Op 13-02-18 om 08:12 schreef dietmar.schind...@manroland-web.com: >> Von: Kang-Che Sung >> Gesendet: Dienstag, 13. Februar 2018 04:52 >>> It says the backslash is special only when followed by the $

Re: [BUG] 'case' does not match double-quoted backslash

2018-02-13 Thread Martijn Dekker
Op 13-02-18 om 08:12 schreef dietmar.schind...@manroland-web.com: > Von: Kang-Che Sung > Gesendet: Dienstag, 13. Februar 2018 04:52 >> It says the backslash is special only when followed by the $ ` " \ >> characters. >> That is, \$ \` \" \\ and \ are special, but none of these >> includes the \z

AW: [BUG] 'case' does not match double-quoted backslash

2018-02-12 Thread dietmar.schindler
> Von: Kang-Che Sung > Gesendet: Dienstag, 13. Februar 2018 04:52 > > On Tue, Feb 13, 2018 at 10:34 AM, Martijn Dekker wrote: > > Op 13-02-18 om 03:09 schreef Kang-Che Sung: > >> Just wondering, why using "\z" and not "\\z" ? > >> The former doesn't seem to be a valid syntax. >

Re: [BUG] 'case' does not match double-quoted backslash

2018-02-12 Thread Kang-Che Sung
On Tue, Feb 13, 2018 at 10:34 AM, Martijn Dekker wrote: > Op 13-02-18 om 03:09 schreef Kang-Che Sung: >> Just wondering, why using "\z" and not "\\z" ? >> The former doesn't seem to be a valid syntax. > > It is valid, though. See the POSIX specification: >

Re: [BUG] 'case' does not match double-quoted backslash

2018-02-12 Thread Martijn Dekker
Op 13-02-18 om 03:09 schreef Kang-Che Sung: > Just wondering, why using "\z" and not "\\z" ? > The former doesn't seem to be a valid syntax. It is valid, though. See the POSIX specification: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_03 ===begin quote===

Re: [BUG] 'case' does not match double-quoted backslash

2018-02-12 Thread Kang-Che Sung
On Tue, Feb 13, 2018 at 5:36 AM, Martijn Dekker wrote: > The following outputs BUG in ash: > > case "\z" in > "\z" ) echo ok ;; > * ) echo BUG ;; > esac > > Apparently `case` has trouble matching the "\z" pattern due to the > backslash within the double quotes. Quoting it

[BUG] 'case' does not match double-quoted backslash

2018-02-12 Thread Martijn Dekker
The following outputs BUG in ash: case "\z" in "\z" ) echo ok ;; * ) echo BUG ;; esac Apparently `case` has trouble matching the "\z" pattern due to the backslash within the double quotes. Quoting it in any other way works. Also, backslash-escaping the backslash within the double quotes is