Set exit status accordingly in printenv(1)

This commit is contained in:
sin 2014-11-16 13:13:31 +00:00
parent 3fa0a358b1
commit b200a6e75f

View File

@ -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;
}