set newline arg if printing multiple directories w/o reg files
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 27 Jun 1989 07:33:53 +0000 (23:33 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 27 Jun 1989 07:33:53 +0000 (23:33 -0800)
SCCS-vsn: bin/ls/ls.c 5.26

usr/src/bin/ls/ls.c

index 22a8772..9ad155b 100644 (file)
@@ -25,7 +25,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)ls.c       5.25 (Berkeley) %G%";
+static char sccsid[] = "@(#)ls.c       5.26 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -309,7 +309,7 @@ doargs(argc, argv)
                for (cnt = 0; cnt < dircnt; ++dstats) {
                        for (endofpath = path, p = dstats->name;
                            *endofpath = *p++; ++endofpath);
                for (cnt = 0; cnt < dircnt; ++dstats) {
                        for (endofpath = path, p = dstats->name;
                            *endofpath = *p++; ++endofpath);
-                       subdir(dstats, regcnt, regcnt || dircnt > 1);
+                       subdir(dstats, regcnt || cnt, regcnt || dircnt > 1);
                        if (++cnt < dircnt && chdir(top)) {
                                (void)fprintf(stderr, "ls: %s: %s\n",
                                    top, strerror(errno));
                        if (++cnt < dircnt && chdir(top)) {
                                (void)fprintf(stderr, "ls: %s: %s\n",
                                    top, strerror(errno));