[hackers] [sbase] Don't indent non-numbered lines in nl(1) || FRIGN

From: <git_AT_suckless.org>
Date: Mon, 23 Mar 2015 18:35:49 +0100 (CET)

commit 7399faec1ff26159c0b57c6fd87f3d46a9c1b93e
Author: FRIGN <dev_AT_frign.de>
Date: Sun Mar 22 18:30:45 2015 +0100

    Don't indent non-numbered lines in nl(1)
    
    This is yet another GNU-specific behaviour we fell for.
    POSIX explicitly states that for non-numbered lines, all indentation-
    crap should be dropped immediately. Well, we didn't listen, so this
    commit will set things straight again.
    Honestly speaking, this also looks much cleaner than before.
    Fuck GNU!

diff --git a/nl.c b/nl.c
index 05c1a2a..e705d2d 100644
--- a/nl.c
+++ b/nl.c
_AT_@ -46,7 +46,7 @@ getsection(char *buf, int *section)
 static void
 nl(const char *fname, FILE *fp)
 {
- size_t i, number = startnum, size = 0;
+ size_t number = startnum, size = 0;
         int donumber, oldsection, section = 1, bl = 1;
         char *buf = NULL;
 
_AT_@ -81,9 +81,6 @@ nl(const char *fname, FILE *fp)
                 if (donumber) {
                         printf(format, width, number, sep);
                         number += incr;
- } else {
- for (i = 0; i < width; i++)
- putchar(' ');
                 }
                 fputs(buf, stdout);
         }
Received on Mon Mar 23 2015 - 18:35:49 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 23 2015 - 18:36:20 CET