Date: Sat, 6 Feb 2010 15:04:35 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 174404 for review Message-ID: <201002061504.o16F4Z8r037586@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=174404 Change 174404 by gabor@gabor_server on 2010/02/06 15:03:57 - style(9) - syntax cleanup Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/util.c#88 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/util.c#88 (text+ko) ==== @@ -60,7 +60,8 @@ FTSENT *p; char *d, *dir; unsigned int i; - int c, fts_flags, ok; + int c, fts_flags; + bool ok; c = fts_flags = 0; @@ -92,7 +93,7 @@ break; default: /* Check for file exclusion/inclusion */ - ok = 1; + ok = true; if (exclflag) { d = strrchr(p->fts_path, '/'); dir = grep_malloc(sizeof(char) * (d - p->fts_path + 2)); @@ -100,20 +101,12 @@ for (i = 0; i < epatterns; ++i) { switch(epattern[i].type) { case FILE_PAT: - if (fnmatch(epattern[i].pat, basename(p->fts_path), 0) == 0) { - if (epattern[i].mode == EXCL_PAT) - ok = 0; - else - ok = 1; - } + if (fnmatch(epattern[i].pat, basename(p->fts_path), 0) == 0) + ok = epattern[i].mode != EXCL_PAT; break; case DIR_PAT: - if (strstr(dir, epattern[i].pat) != NULL) { - if (epattern[i].mode == EXCL_PAT) - ok = 0; - else - ok = 1; - } + if (strstr(dir, epattern[i].pat) != NULL) + ok = epattern[i].mode != EXCL_PAT; break; } } @@ -408,13 +401,13 @@ ++n; } if (nflag) { - if (n) + if (n > 0) putchar(sep); printf("%d", line->line_no); ++n; } if (bflag) { - if (n) + if (n > 0) putchar(sep); printf("%lld", (long long)line->off); ++n;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002061504.o16F4Z8r037586>