(wrong string) ée

From: <git_AT_suckless.org>
Date: Wed, 20 Apr 2016 23:57:48 +0200 (CEST)

commit 7250fb69686b4c0131e4cef3904003fb1124851e
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Wed Mar 30 01:16:27 2016 +0200
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Apr 20 22:57:40 2016 +0100

    printenv: exit status is 2 on failure
    
    This provides a reliable and portable way to
    test whether an environment variable is defined.
    
    (Of course, if you are using glibc you may get
    false positives if you include a = in the query.)
    
    Signed-off-by: Mattias Andrée <maandree_AT_kth.se>

diff --git a/printenv.1 b/printenv.1
index a61efe9..dc45c8a 100644
--- a/printenv.1
+++ b/printenv.1
_AT_@ -1,4 +1,4 @@
-.Dd 2015-10-08
+.Dd 2016-03-30
 .Dt PRINTENV 1
 .Os sbase
 .Sh NAME
_AT_@ -16,5 +16,14 @@ is given. Otherwise,
 prints only the value of each
 .Ar var
 one per line in the order specified.
+.SH EXIT STATUS
+.Bl -tag -width Ds
+.It 0
+Successful completion.
+.It 1
+One or more queried variables were not found.
+.It > 1
+An error occurred.
+.El
 .Sh SEE ALSO
 .Xr env 1
diff --git a/printenv.c b/printenv.c
index 2c1e711..2e1d15b 100644
--- a/printenv.c
+++ b/printenv.c
_AT_@ -26,5 +26,5 @@ main(int argc, char *argv[])
                 }
         }
 
- return fshut(stdout, "<stdout>") || ret;
+ return fshut(stdout, "<stdout>") ? 2 : ret;
 }
Received on Wed Apr 20 2016 - 23:57:48 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 21 2016 - 00:01:00 CEST