bug-coreutils
[Top][All Lists]
Advanced

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

who -q outputs a trailing space


From: Paul Eggert
Subject: who -q outputs a trailing space
Date: Fri, 11 Jun 2004 18:27:27 -0700

"who -q" outputs a trailing space.  Here's a patch.

2004-06-11  Paul Eggert  <address@hidden>

        * src/who.c (list_entries_who): Don't output a trailing space.

Index: who.c
===================================================================
RCS file: /home/meyering/coreutils/cu/src/who.c,v
retrieving revision 1.92
diff -p -u -r1.92 who.c
--- who.c       18 Apr 2004 15:02:49 -0000      1.92
+++ who.c       12 Jun 2004 01:24:19 -0000
@@ -519,6 +519,7 @@ static void
 list_entries_who (int n, const STRUCT_UTMP *utmp_buf)
 {
   int entries = 0;
+  char const *separator = "";
 
   while (n--)
     {
@@ -528,8 +529,9 @@ list_entries_who (int n, const STRUCT_UT
 
          trimmed_name = extract_trimmed_name (utmp_buf);
 
-         printf ("%s ", trimmed_name);
+         printf ("%s%s", separator, trimmed_name);
          free (trimmed_name);
+         separator = " ";
          entries++;
        }
       utmp_buf++;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]