sh: Add UTF-8 support to pattern matching.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 21 Aug 2011 20:48:41 +0000 (13:48 -0700)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 21 Aug 2011 20:48:41 +0000 (13:48 -0700)
commitead7935bf6ca5dacd4abb1380eb3ac771c15e8c9
tree9811ad6db2d85fb0b5c040de4c84ccab94f02acd
parentfd296645cf39f03871a074f874002400f2e9c8a9
sh: Add UTF-8 support to pattern matching.

?, [...] patterns match codepoints instead of bytes. They do not match
invalid sequences. [...] patterns must not contain invalid sequences
otherwise they will not match anything. This is so that ${var#?} removes
the first codepoint, not the first byte, without putting UTF-8 knowledge
into the ${var#pattern} code. However, * continues to match any string
and an invalid sequence matches an identical invalid sequence. (This
differs from fnmatch(3).)

Obtained-from:   FreeBSD SVN rev 221646 & 223010
bin/sh/expand.c
tools/regression/bin/sh/builtins/case5.0 [new file with mode: 0644]
tools/regression/bin/sh/expansion/trim8.0 [new file with mode: 0644]