mirror of
https://github.com/sheumann/hush.git
synced 2024-12-23 05:29:58 +00:00
hush: optimize type builtin a bit more
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
dd6b211921
commit
5d7cca2090
11
shell/hush.c
11
shell/hush.c
@ -6785,15 +6785,14 @@ static int builtin_type(char **argv)
|
|||||||
type = "a shell builtin";
|
type = "a shell builtin";
|
||||||
else if ((path = find_in_path(*argv)) != NULL)
|
else if ((path = find_in_path(*argv)) != NULL)
|
||||||
type = path;
|
type = path;
|
||||||
|
else {
|
||||||
if (!type) {
|
|
||||||
bb_error_msg("type: %s: not found", *argv);
|
bb_error_msg("type: %s: not found", *argv);
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
} else
|
continue;
|
||||||
printf("%s is %s\n", *argv, type);
|
}
|
||||||
|
|
||||||
if (path)
|
printf("%s is %s\n", *argv, type);
|
||||||
free(path);
|
free(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user