[hackers] [sbase] Respect exit status in expand(1) || sin

From: <git_AT_suckless.org>
Date: Fri, 21 Nov 2014 18:53:36 +0100

commit e6df377504b60e231ee6de60f2ba0e5dd0975fab
Author: sin <sin_AT_2f30.org>
Date: Fri Nov 21 17:53:22 2014 +0000

    Respect exit status in expand(1)

diff --git a/expand.c b/expand.c
index 60c5623..2449a8e 100644
--- a/expand.c
+++ b/expand.c
_AT_@ -20,6 +20,7 @@ main(int argc, char *argv[])
 {
         FILE *fp;
         int tabstop = 8;
+ int ret = 0;
 
         ARGBEGIN {
         case 'i':
_AT_@ -38,13 +39,14 @@ main(int argc, char *argv[])
                 for (; argc > 0; argc--, argv++) {
                         if (!(fp = fopen(argv[0], "r"))) {
                                 weprintf("fopen %s:", argv[0]);
+ ret = 1;
                                 continue;
                         }
                         expand(argv[0], fp, tabstop);
                         fclose(fp);
                 }
         }
- return 0;
+ return ret;
 }
 
 static int
Received on Fri Nov 21 2014 - 18:53:36 CET

This archive was generated by hypermail 2.3.0 : Fri Nov 21 2014 - 19:00:13 CET