summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2023-04-01 11:11:20 +0200
committerDenys Vlasenko2023-04-01 11:11:20 +0200
commit00fc1368437f66c6e67ed45a17326e5f2573ea65 (patch)
tree68896d29149e1bf32ad98067b059e1c863ad9672
parent262a84547798cf795d9748329f2ad251117801cc (diff)
downloadbusybox-00fc1368437f66c6e67ed45a17326e5f2573ea65.zip
busybox-00fc1368437f66c6e67ed45a17326e5f2573ea65.tar.gz
ash: code shrink
function old new delta describe_command 323 320 -3 dotcmd 324 309 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-18) Total: -18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 45e5522..2ec7cfb 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8729,8 +8729,6 @@ describe_command(char *command, const char *path, int describe_command_verbose)
const struct alias *ap;
#endif
- path = path ? path : pathval();
-
if (describe_command_verbose) {
out1str(command);
}
@@ -8755,6 +8753,7 @@ describe_command(char *command, const char *path, int describe_command_verbose)
}
#endif
/* Brute force */
+ path = path ? path : pathval();
find_command(command, &entry, DO_ABS, path);
switch (entry.cmdtype) {
@@ -13624,7 +13623,7 @@ static char *
find_dot_file(char *basename)
{
char *fullname;
- const char *path = pathval();
+ const char *path;
struct stat statb;
int len;
@@ -13632,6 +13631,7 @@ find_dot_file(char *basename)
if (strchr(basename, '/'))
return basename;
+ path = pathval();
while ((len = padvance(&path, basename)) >= 0) {
fullname = stackblock();
if ((!pathopt || *pathopt == 'f')