From 8b1676e3b7bca183fea725d38d62350d2688078b Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Sat, 12 Sep 2015 20:35:56 +0900 Subject: 36491: Multibyte support for parameter expansion flags B,E,N --- Src/glob.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Src/glob.c') diff --git a/Src/glob.c b/Src/glob.c index dea1bf50e..43d135b99 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -2491,17 +2491,17 @@ get_match_ret(char *s, int b, int e, int fl, char *replstr, ll += 1 + (l - (e - b)); if (fl & SUB_BIND) { /* position of start of matched portion */ - sprintf(buf, "%d ", b + 1); + sprintf(buf, "%d ", MB_METASTRLEN2END(s, 0, s+b) + 1); ll += (bl = strlen(buf)); } if (fl & SUB_EIND) { /* position of end of matched portion */ - sprintf(buf + bl, "%d ", e + 1); + sprintf(buf + bl, "%d ", MB_METASTRLEN2END(s, 0, s+e) + 1); ll += (bl = strlen(buf)); } if (fl & SUB_LEN) { /* length of matched portion */ - sprintf(buf + bl, "%d ", e - b); + sprintf(buf + bl, "%d ", MB_METASTRLEN2END(s+b, 0, s+e)); ll += (bl = strlen(buf)); } if (bl) -- cgit 1.4.1