diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-29 14:05:27 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-29 14:05:27 +0000 |
commit | dee82b6b78fab258584414557915e5169b051665 (patch) | |
tree | e09eaeb4832f990daedec526233b4a0562b33cf5 | |
parent | 1bab1de69866c38c3e9924d23f21a90623a0a6dc (diff) | |
download | busybox-w32-dee82b6b78fab258584414557915e5169b051665.tar.gz busybox-w32-dee82b6b78fab258584414557915e5169b051665.tar.bz2 busybox-w32-dee82b6b78fab258584414557915e5169b051665.zip |
ash: comment non-obvious code part
-rw-r--r-- | shell/ash.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index 5f4d1767e..d34f5207f 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -11121,14 +11121,16 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) | |||
11121 | loop: | 11121 | loop: |
11122 | while ((fullname = padvance(&path, name)) != NULL) { | 11122 | while ((fullname = padvance(&path, name)) != NULL) { |
11123 | stunalloc(fullname); | 11123 | stunalloc(fullname); |
11124 | /* NB: code below will still use fullname | ||
11125 | * despite it being "unallocated" */ | ||
11124 | idx++; | 11126 | idx++; |
11125 | if (pathopt) { | 11127 | if (pathopt) { |
11126 | if (prefix(pathopt, "builtin")) { | 11128 | if (prefix(pathopt, "builtin")) { |
11127 | if (bcmd) | 11129 | if (bcmd) |
11128 | goto builtin_success; | 11130 | goto builtin_success; |
11129 | continue; | 11131 | continue; |
11130 | } else if (!(act & DO_NOFUNC) && | 11132 | } else if (!(act & DO_NOFUNC) |
11131 | prefix(pathopt, "func")) { | 11133 | && prefix(pathopt, "func")) { |
11132 | /* handled below */ | 11134 | /* handled below */ |
11133 | } else { | 11135 | } else { |
11134 | /* ignore unimplemented options */ | 11136 | /* ignore unimplemented options */ |
@@ -11156,6 +11158,9 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) | |||
11156 | continue; | 11158 | continue; |
11157 | if (pathopt) { /* this is a %func directory */ | 11159 | if (pathopt) { /* this is a %func directory */ |
11158 | stalloc(strlen(fullname) + 1); | 11160 | stalloc(strlen(fullname) + 1); |
11161 | /* NB: stalloc will return space pointed by fullname | ||
11162 | * (because we don't have any intervening allocations | ||
11163 | * between stunalloc above and this stalloc) */ | ||
11159 | readcmdfile(fullname); | 11164 | readcmdfile(fullname); |
11160 | cmdp = cmdlookup(name, 0); | 11165 | cmdp = cmdlookup(name, 0); |
11161 | if (cmdp == NULL || cmdp->cmdtype != CMDFUNCTION) | 11166 | if (cmdp == NULL || cmdp->cmdtype != CMDFUNCTION) |