Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/error counting was off, and setting things to themse...



details:   https://anonhg.NetBSD.org/src/rev/4c56bca39004
branches:  trunk
changeset: 765132:4c56bca39004
user:      christos <christos%NetBSD.org@localhost>
date:      Fri May 20 02:00:45 2011 +0000

description:
counting was off, and setting things to themselves does not work very welll.

diffstat:

 usr.bin/error/touch.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (50 lines):

diff -r 71c25e209540 -r 4c56bca39004 usr.bin/error/touch.c
--- a/usr.bin/error/touch.c     Fri May 20 01:59:14 2011 +0000
+++ b/usr.bin/error/touch.c     Fri May 20 02:00:45 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: touch.c,v 1.23 2011/05/19 22:55:53 christos Exp $      */
+/*     $NetBSD: touch.c,v 1.24 2011/05/20 02:00:45 christos Exp $      */
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)touch.c    8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: touch.c,v 1.23 2011/05/19 22:55:53 christos Exp $");
+__RCSID("$NetBSD: touch.c,v 1.24 2011/05/20 02:00:45 christos Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -92,7 +92,7 @@
 {
        const char *p;
 
-       if (level-- == 0)
+       if (level == 0)
                return name;
 
        if (*name == '/') {
@@ -172,7 +172,7 @@
                            filelevel);
                        if (strcmp(fname, name) != 0) {
                                my_nfiles++;
-                               name = name;
+                               name = fname;
                        }
                }
        }
@@ -215,10 +215,10 @@
                                my_nfiles, plural(my_nfiles), verbform(my_nfiles));
                if (!terse) {
                        FILEITERATE(fi, 1, my_nfiles) {
+                               const char *fname = makename(
+                                   (*my_files[fi])->error_text[0], filelevel);
                                fprintf(stdout, "%s\"%s\" (%d)",
-                                       sep, makename(
-                                       (*my_files[fi])->error_text[0],
-                                       filelevel),
+                                       sep, fname,
                                        (int)(my_files[fi+1] - my_files[fi]));
                                sep = ", ";
                        }



Home | Main Index | Thread Index | Old Index