]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
A specified format is no longer automatically newline terminated.
authorJim Meyering <jim@meyering.net>
Sun, 4 Apr 2004 16:22:26 +0000 (16:22 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 4 Apr 2004 16:22:26 +0000 (16:22 +0000)
If you want a newline at the end of your format, use `\n'.

(print_it): Don't print a newline at the end of
every format.
(do_statfs): Add a newline at end of each default format string.

src/stat.c

index 527ccf2fe764cfdcab73c354fa5be0495976914d..cf2dd0fbecbde508f981313232e1dd7c7818475f 100644 (file)
@@ -610,7 +610,6 @@ print_it (char const *masterformat, char const *filename,
     }
   free (format);
   free (dest);
-  fputc ('\n', stdout);
 }
 
 /* stat the filesystem and print what we find */
@@ -630,11 +629,11 @@ do_statfs (char const *filename, int terse, char const *format)
   if (format == NULL)
     {
       format = (terse
-               ? "%n %i %l %t %b %f %a %s %c %d"
+               ? "%n %i %l %t %b %f %a %s %c %d\n"
                : "  File: \"%n\"\n"
                "    ID: %-8i Namelen: %-7l Type: %T\n"
                "Blocks: Total: %-10b Free: %-10f Available: %-10a Size: %s\n"
-               "Inodes: Total: %-10c Free: %-10d");
+               "Inodes: Total: %-10c Free: %-10d\n");
     }
 
   print_it (format, filename, print_statfs, &statfsbuf);
@@ -660,7 +659,7 @@ do_stat (char const *filename, int follow_links, int terse,
     {
       if (terse != 0)
        {
-         format = "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o";
+         format = "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\n";
        }
       else
        {
@@ -674,7 +673,7 @@ do_stat (char const *filename, int follow_links, int terse,
                "Device: %Dh/%dd\tInode: %-10i  Links: %-5h"
                " Device type: %t,%T\n"
                "Access: (%04a/%10.10A)  Uid: (%5u/%8U)   Gid: (%5g/%8G)\n"
-               "Access: %x\n" "Modify: %y\n" "Change: %z";
+               "Access: %x\n" "Modify: %y\n" "Change: %z\n";
            }
          else
            {
@@ -683,7 +682,7 @@ do_stat (char const *filename, int follow_links, int terse,
                "  Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n"
                "Device: %Dh/%dd\tInode: %-10i  Links: %h\n"
                "Access: (%04a/%10.10A)  Uid: (%5u/%8U)   Gid: (%5g/%8G)\n"
-               "Access: %x\n" "Modify: %y\n" "Change: %z";
+               "Access: %x\n" "Modify: %y\n" "Change: %z\n";
            }
        }
     }