don't print a space before the first keyword
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 4 Jun 1991 07:24:57 +0000 (23:24 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 4 Jun 1991 07:24:57 +0000 (23:24 -0800)
SCCS-vsn: bin/ps/keyword.c 5.7

usr/src/bin/ps/keyword.c

index 267be39..48adebe 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)keyword.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)keyword.c  5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -243,14 +243,15 @@ showkey()
        register char *p, *sep;
 
        i = 0;
        register char *p, *sep;
 
        i = 0;
+       sep = "";
        for (v = var; *(p = v->name); ++v) {
                len = strlen(p);
                if (termwidth && (i += len + 1) > termwidth) {
                        i = len;
                        sep = "\n";
        for (v = var; *(p = v->name); ++v) {
                len = strlen(p);
                if (termwidth && (i += len + 1) > termwidth) {
                        i = len;
                        sep = "\n";
-               } else
-                       sep = " ";
+               }
                (void) printf("%s%s", sep, p);
                (void) printf("%s%s", sep, p);
+               sep = " ";
        }
        (void) printf("\n");
 }
        }
        (void) printf("\n");
 }