Displaying 1 result from an estimated 1 matches for "legal_pathopt".
2020 Mar 28
0
[klibc:update-dash] dash: exec: Stricter pathopt parsing
...rintentry(struct tblentry *);
-STATIC void clearcmdentry(int);
+STATIC void clearcmdentry(void);
STATIC struct tblentry *cmdlookup(const char *, int);
STATIC void delete_cmd_entry(void);
STATIC void addcmdentry(char *, struct cmdentry *);
@@ -168,7 +168,27 @@ repeat:
}
}
+static const char *legal_pathopt(const char *opt, const char *term, int magic)
+{
+ switch (magic) {
+ case 0:
+ opt = NULL;
+ break;
+ case 1:
+ opt = prefix(opt, "builtin") ?: prefix(opt, "func");
+ break;
+
+ default:
+ opt += strcspn(opt, term);
+ break;
+ }
+
+ if (opt && *opt == '%'...