git: sh: Add UTF-8 support to pattern matching.

看板DFBSD_commit作者時間14年前 (2011/08/22 08:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit ead7935bf6ca5dacd4abb1380eb3ac771c15e8c9 Author: Peter Avalos <pavalos@dragonflybsd.org> Date: Sun Aug 21 13:48:41 2011 -0700 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 Summary of changes: bin/sh/expand.c | 66 ++++++++++++++++++++----- tools/regression/bin/sh/builtins/case5.0 | 57 ++++++++++++++++++++++ tools/regression/bin/sh/expansion/trim8.0 | 75 +++++++++++++++++++++++++++++ 3 files changed, 184 insertions(+), 14 deletions(-) create mode 100644 tools/regression/bin/sh/builtins/case5.0 create mode 100644 tools/regression/bin/sh/expansion/trim8.0 http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ead7935bf6ca5dacd4abb1380eb3ac771c15e8c9 -- DragonFly BSD source repository
文章代碼(AID): #1EKPnFTm (DFBSD_commit)