From 2abba7243a736a2fc626f3cc917d8a67014d4d20 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 5 Jun 2015 11:21:22 +0100 Subject: 35386: expand tabs where useful in builtins outputing function. Also add to zed -f. Option is -x . --- Src/pattern.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'Src/pattern.c') 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", -- cgit v1.2.3