[hackers] [sbase] paste: fix warning on indentation in parallel() || Robert Karl

From: <git_AT_suckless.org>
Date: Tue, 27 Dec 2016 15:04:03 +0100 (CET)

commit 60da4fb049eb1168331d0754e34519af3627a2e8
Author: Robert Karl <robertkarljr_AT_gmail.com>
AuthorDate: Mon Dec 26 16:22:36 2016 -0800
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Tue Dec 27 15:02:15 2016 +0100

    paste: fix warning on indentation in parallel()
    
    _Bug_
    Got the following error after cloning and running make:
    
    paste.c: In function ‘parallel’:
    paste.c:70:4: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
        else
        ^~~~
    paste.c:72:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘else’
         last++;
         ^~~~
    This patch preserves the same functionality and just adjusts indentation to squelch the warning.
    
    _Test plan_
    Used the following 'script' to convince myself output looked correct for inputs
    where the latter arguments to paste had fewer lines.
    
            make && printf "1\n2\n" > two.txt && printf "" > zero.txt && ./paste -d, two.txt zero.txt

diff --git a/paste.c b/paste.c
index 77fc090..1d4e9f6 100644
--- a/paste.c
+++ b/paste.c
_AT_@ -69,7 +69,7 @@ nextline:
                                 putchar('\n');
                         else
                                 efputrune(&d, stdout, "<stdout>");
- last++;
+ last++;
                 }
         }
         if (last != -1)
Received on Tue Dec 27 2016 - 15:04:03 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 27 2016 - 15:13:52 CET