search for: pathopt

Displaying 4 results from an estimated 4 matches for "pathopt".

2020 Mar 28
0
[klibc:update-dash] dash: exec: Stricter pathopt parsing
.../klibc.git;a=commit;h=604d3a0a1570f3478360913c2935ea53d18857e6 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Sat, 19 May 2018 02:39:50 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:55 +0000 [klibc] dash: exec: Stricter pathopt parsing [ dash commit a068bf7aa310e8d36ae11c2aec47af1446a18827 ] This patch changes the parsing of pathopt. First of all only %builtin and %func (with arbitrary suffixes) will be recognised. Any other pathopt will be treated as a normal directory. Furthermore, pathopt can now be specified befor...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Do not allocate stack string in padvance
...usr/dash/exec.c @@ -118,13 +118,13 @@ shellexec(char **argv, const char *path, int idx) e = errno; } else { e = ENOENT; - while ((cmdname = padvance(&path, argv[0])) != NULL) { + while (padvance(&path, argv[0]) >= 0) { + cmdname = stackblock(); if (--idx < 0 && pathopt == NULL) { tryexec(cmdname, argv, envp); if (errno != ENOENT && errno != ENOTDIR) e = errno; } - stunalloc(cmdname); } } @@ -182,8 +182,7 @@ repeat: const char *pathopt; -char * -padvance(const char **path, const char *name) +int padvance(const char **path,...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add vfork support
...dash/exec.h b/usr/dash/exec.h index 2b318257..423b07e6 100644 --- a/usr/dash/exec.h +++ b/usr/dash/exec.h @@ -58,6 +58,8 @@ struct cmdentry { #define DO_ALTPATH 0x08 /* using alternate path */ #define DO_REGBLTIN 0x10 /* regular built-ins and functions only */ +union node; + extern const char *pathopt; /* set by padvance */ void shellexec(char **, const char *, int) diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c index 9e7244e1..989907ed 100644 --- a/usr/dash/jobs.c +++ b/usr/dash/jobs.c @@ -53,6 +53,7 @@ #include <termios.h> #undef CEOF /* syntax.h redefines this */ #endif +#includ...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add assignment built-in support again
...* checks absolute paths */ #define DO_NOFUNC 0x04 /* don't return shell functions, for command */ #define DO_ALTPATH 0x08 /* using alternate path */ -#define DO_ALTBLTIN 0x20 /* %builtin in alt. path */ +#define DO_REGBLTIN 0x10 /* regular built-ins and functions only */ extern const char *pathopt; /* set by padvance */ diff --git a/usr/dash/parser.c b/usr/dash/parser.c index 3de977c1..c4e63781 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -125,8 +125,7 @@ STATIC void synerror(const char *) __attribute__((__noreturn__)); STATIC void setprompt(int); -static inline int -isas...