mirror of
https://github.com/sheumann/hush.git
synced 2025-01-18 07:31:34 +00:00
ash: comment non-obvious code part
This commit is contained in:
parent
1bab1de698
commit
dee82b6b78
@ -11121,14 +11121,16 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
|
|||||||
loop:
|
loop:
|
||||||
while ((fullname = padvance(&path, name)) != NULL) {
|
while ((fullname = padvance(&path, name)) != NULL) {
|
||||||
stunalloc(fullname);
|
stunalloc(fullname);
|
||||||
|
/* NB: code below will still use fullname
|
||||||
|
* despite it being "unallocated" */
|
||||||
idx++;
|
idx++;
|
||||||
if (pathopt) {
|
if (pathopt) {
|
||||||
if (prefix(pathopt, "builtin")) {
|
if (prefix(pathopt, "builtin")) {
|
||||||
if (bcmd)
|
if (bcmd)
|
||||||
goto builtin_success;
|
goto builtin_success;
|
||||||
continue;
|
continue;
|
||||||
} else if (!(act & DO_NOFUNC) &&
|
} else if (!(act & DO_NOFUNC)
|
||||||
prefix(pathopt, "func")) {
|
&& prefix(pathopt, "func")) {
|
||||||
/* handled below */
|
/* handled below */
|
||||||
} else {
|
} else {
|
||||||
/* ignore unimplemented options */
|
/* ignore unimplemented options */
|
||||||
@ -11156,6 +11158,9 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
|
|||||||
continue;
|
continue;
|
||||||
if (pathopt) { /* this is a %func directory */
|
if (pathopt) { /* this is a %func directory */
|
||||||
stalloc(strlen(fullname) + 1);
|
stalloc(strlen(fullname) + 1);
|
||||||
|
/* NB: stalloc will return space pointed by fullname
|
||||||
|
* (because we don't have any intervening allocations
|
||||||
|
* between stunalloc above and this stalloc) */
|
||||||
readcmdfile(fullname);
|
readcmdfile(fullname);
|
||||||
cmdp = cmdlookup(name, 0);
|
cmdp = cmdlookup(name, 0);
|
||||||
if (cmdp == NULL || cmdp->cmdtype != CMDFUNCTION)
|
if (cmdp == NULL || cmdp->cmdtype != CMDFUNCTION)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user