[hackers] [sbase] Set exit status accordingly in printenv(1) || sin

From: <git_AT_suckless.org>
Date: Sun, 16 Nov 2014 14:14:17 +0100

commit b200a6e75f4885c3e91acccdea231a2a32cbc187
Author: sin <sin_AT_2f30.org>
Date: Sun Nov 16 13:13:31 2014 +0000

    Set exit status accordingly in printenv(1)

diff --git a/printenv.c b/printenv.c
index 358e714..abed873 100644
--- a/printenv.c
+++ b/printenv.c
_AT_@ -16,6 +16,7 @@ int
 main(int argc, char *argv[])
 {
         char *var;
+ int ret = 0;
 
         ARGBEGIN {
         default:
_AT_@ -29,8 +30,10 @@ main(int argc, char *argv[])
                 while (*argv) {
                         if ((var = getenv(*argv)))
                                 printf("%s\n", var);
+ else
+ ret = 1;
                         argv++;
                 }
         }
- return 0;
+ return ret;
 }
Received on Sun Nov 16 2014 - 14:14:17 CET

This archive was generated by hypermail 2.3.0 : Sun Nov 16 2014 - 14:24:09 CET