search for: readcmdfile

Displaying 3 results from an estimated 3 matches for "readcmdfile".

2020 Mar 28
0
[klibc:update-dash] dash: eval: Reset handler when entering a subshell
...int argc, char **argv) exraise(EXEXIT); /* NOTREACHED */ } + +void reset_handler(void) +{ + handler = &main_handler; +} diff --git a/usr/dash/main.h b/usr/dash/main.h index 19e49835..51f1604c 100644 --- a/usr/dash/main.h +++ b/usr/dash/main.h @@ -52,3 +52,4 @@ extern int *dash_errno; void readcmdfile(char *); int dotcmd(int, char **); int exitcmd(int, char **); +void reset_handler(void);
2020 Mar 28
0
[klibc:update-dash] dash: exec: Do not allocate stack string in padvance
...me)) >= 0) { + fullname = stackblock(); idx++; if (pathopt) { if (prefix(pathopt, "builtin")) { @@ -398,7 +398,7 @@ loop: if (!S_ISREG(statb.st_mode)) continue; if (pathopt) { /* this is a %func directory */ - stalloc(strlen(fullname) + 1); + stalloc(len); readcmdfile(fullname); if ((cmdp = cmdlookup(name, 0)) == NULL || cmdp->cmdtype != CMDFUNCTION) @@ -789,9 +789,9 @@ describe_command(out, command, path, verbose) p = command; } else { do { - p = padvance(&path, command); - stunalloc(p); + padvance(&path, command);...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Stricter pathopt parsing
...else { /* ignore unimplemented options */ @@ -397,7 +443,7 @@ loop: e = EACCES; /* if we fail, this will be the error */ if (!S_ISREG(statb.st_mode)) continue; - if (pathopt) { /* this is a %func directory */ + if (lpathopt) { /* this is a %func directory */ stalloc(len); readcmdfile(fullname); if ((cmdp = cmdlookup(name, 0)) == NULL || @@ -515,39 +561,26 @@ hashcd(void) void changepath(const char *newval) { - const char *old, *new; + const char *new; int idx; - int firstchange; int bltin; - old = pathval(); new = newval; - firstchange = 9999; /* assume no change...