Set exit status accordingly in printenv(1)
This commit is contained in:
parent
3fa0a358b1
commit
b200a6e75f
|
@ -16,6 +16,7 @@ int
|
|||
main(int argc, char *argv[])
|
||||
{
|
||||
char *var;
|
||||
int ret = 0;
|
||||
|
||||
ARGBEGIN {
|
||||
default:
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user