'case' UTF-8 bug

Denys Vlasenko vda.linux at googlemail.com
Wed Jul 5 20:23:57 UTC 2017


On Wed, Jul 5, 2017 at 8:56 PM, Martijn Dekker <martijn at inlv.org> wrote:
> Op 05-07-17 om 19:15 schreef Denys Vlasenko:
>> Fix is in git, please try and let me know how does it work.
>
> It fixes the bug I reported, but it introduces a new bug: the presence
> of a quoted closing square bracket in a pattern (whether it's quoted
> literally or passed from a variable) causes the pattern to never match.
>
> The following all fail:
>
> case e in
> ( *[!ab\]cd]* ) echo ok_sq1 ;;
> ( * ) echo WRONG_sq1 ;;
> esac
> case \] in
> ( *[ab\]cd]* ) echo ok_sq2 ;;
> ( * ) echo WRONG_sq2 ;;
> esac
> case a in
> ( *[ab\]cd]* ) echo ok_sq3 ;;
> ( * ) echo WRONG_sq3 ;;
> esac

Thanks!

Fixed in git, please confirm.


More information about the busybox mailing list