Date: Wed, 9 Jul 2008 14:52:15 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 144945 for review Message-ID: <200807091452.m69EqFuP079609@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=144945 Change 144945 by gabor@gabor_server on 2008/07/09 14:51:53 - Merge two if's Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/util.c#56 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/util.c#56 (text+ko) ==== @@ -239,20 +239,17 @@ if (r == 0 && xflag) if (pmatch.rm_so != 0 || pmatch.rm_eo != l->len) r = REG_NOMATCH; - if (r == 0 && wflag) { + if (r == 0 && wflag && pmatch.rm_so != 0 && pmatch.rm_eo != l->len) { wchar_t *wbegin; wint_t wend; - if (pmatch.rm_so != 0 && pmatch.rm_eo != l->len) { - wbegin = grep_malloc(mbstowcs(NULL, l->dat, pmatch.rm_so)); - if (mbstowcs(wbegin, l->dat, pmatch.rm_so) == -1) - r = REG_NOMATCH; - - wend = sscanf(&l->dat[pmatch.rm_eo], "%lc", &wend); - if (iswword(wbegin[wcslen(wbegin)]) ||iswword(wend)) - r = REG_NOMATCH; - free(wbegin); - } + wbegin = grep_malloc(mbstowcs(NULL, l->dat, pmatch.rm_so)); + if (mbstowcs(wbegin, l->dat, pmatch.rm_so) == -1) + r = REG_NOMATCH; + wend = sscanf(&l->dat[pmatch.rm_eo], "%lc", &wend); + if (iswword(wbegin[wcslen(wbegin)]) ||iswword(wend)) + r = REG_NOMATCH; + free(wbegin); } if (r == t) { if (m == 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807091452.m69EqFuP079609>