From owner-p4-projects@FreeBSD.ORG Sat Feb 6 15:04:35 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BBF39106568F; Sat, 6 Feb 2010 15:04:35 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80A321065672 for ; Sat, 6 Feb 2010 15:04:35 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6F87C8FC0A for ; Sat, 6 Feb 2010 15:04:35 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o16F4ZOf037588 for ; Sat, 6 Feb 2010 15:04:35 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o16F4Z8r037586 for perforce@freebsd.org; Sat, 6 Feb 2010 15:04:35 GMT (envelope-from gabor@freebsd.org) Date: Sat, 6 Feb 2010 15:04:35 GMT Message-Id: <201002061504.o16F4Z8r037586@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 174404 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2010 15:04:36 -0000 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;