diff options
author | Peter Stephenson <pws@zsh.org> | 2015-06-05 11:21:22 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2015-06-05 11:21:22 +0100 |
commit | 2abba7243a736a2fc626f3cc917d8a67014d4d20 (patch) | |
tree | c91850e5786a9a8e0c9ebbedc65abbc3a3131cd0 /Src/pattern.c | |
parent | 4804a7c5ff144fc7cc974484d16f2f88cc131264 (diff) | |
download | zsh-2abba7243a736a2fc626f3cc917d8a67014d4d20.tar.gz zsh-2abba7243a736a2fc626f3cc917d8a67014d4d20.tar.xz zsh-2abba7243a736a2fc626f3cc917d8a67014d4d20.zip |
35386: expand tabs where useful in builtins outputing function.
Also add to zed -f. Option is -x <numm>.
Diffstat (limited to 'Src/pattern.c')
-rw-r--r-- | Src/pattern.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Src/pattern.c b/Src/pattern.c index 4e5e8a110..7e07548f9 100644 --- a/Src/pattern.c +++ b/Src/pattern.c @@ -2202,20 +2202,15 @@ pattryrefs(Patprog prog, char *string, int stringlen, int unmetalen, if ((patglobflags & GF_MATCHREF) && !(patflags & PAT_FILE)) { char *str = ztrduppfx(patinstart, patinlen); - char *ptr = patinstart; - int mlen = 0; + int mlen; /* * Count the characters. We're not using CHARSUB() - * because the string is still metafied. We're - * not using mb_metastrlen() because that expects - * the string to be null terminated. + * because the string is still metafied. */ MB_METACHARINIT(); - while (ptr < patinstart + patinlen) { - mlen++; - ptr += MB_METACHARLEN(ptr); - } + mlen = MB_METASTRLEN2END(patinstart, 0, + patinstart + patinlen); setsparam("MATCH", str); setiparam("MBEGIN", |