aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-04-01 11:11:20 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2023-04-01 11:11:20 +0200
commit00fc1368437f66c6e67ed45a17326e5f2573ea65 (patch)
tree68896d29149e1bf32ad98067b059e1c863ad9672
parent262a84547798cf795d9748329f2ad251117801cc (diff)
downloadbusybox-w32-00fc1368437f66c6e67ed45a17326e5f2573ea65.tar.gz
busybox-w32-00fc1368437f66c6e67ed45a17326e5f2573ea65.tar.bz2
busybox-w32-00fc1368437f66c6e67ed45a17326e5f2573ea65.zip
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 45e552217..2ec7cfb0e 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -8729,8 +8729,6 @@ describe_command(char *command, const char *path, int describe_command_verbose)
8729 const struct alias *ap; 8729 const struct alias *ap;
8730#endif 8730#endif
8731 8731
8732 path = path ? path : pathval();
8733
8734 if (describe_command_verbose) { 8732 if (describe_command_verbose) {
8735 out1str(command); 8733 out1str(command);
8736 } 8734 }
@@ -8755,6 +8753,7 @@ describe_command(char *command, const char *path, int describe_command_verbose)
8755 } 8753 }
8756#endif 8754#endif
8757 /* Brute force */ 8755 /* Brute force */
8756 path = path ? path : pathval();
8758 find_command(command, &entry, DO_ABS, path); 8757 find_command(command, &entry, DO_ABS, path);
8759 8758
8760 switch (entry.cmdtype) { 8759 switch (entry.cmdtype) {
@@ -13624,7 +13623,7 @@ static char *
13624find_dot_file(char *basename) 13623find_dot_file(char *basename)
13625{ 13624{
13626 char *fullname; 13625 char *fullname;
13627 const char *path = pathval(); 13626 const char *path;
13628 struct stat statb; 13627 struct stat statb;
13629 int len; 13628 int len;
13630 13629
@@ -13632,6 +13631,7 @@ find_dot_file(char *basename)
13632 if (strchr(basename, '/')) 13631 if (strchr(basename, '/'))
13633 return basename; 13632 return basename;
13634 13633
13634 path = pathval();
13635 while ((len = padvance(&path, basename)) >= 0) { 13635 while ((len = padvance(&path, basename)) >= 0) {
13636 fullname = stackblock(); 13636 fullname = stackblock();
13637 if ((!pathopt || *pathopt == 'f') 13637 if ((!pathopt || *pathopt == 'f')