search for: find_command

Displaying 10 results from an estimated 10 matches for "find_command".

2020 Mar 28
0
[klibc:update-dash] dash: eval: Add assignment built-in support again
...= argp->narg.next) { - struct strlist **spp; + argp = cmd->ncmd.args; + if ((osp = fill_arglist(&arglist, &argp))) { + int pseudovarflag = 0; - spp = arglist.lastp; - expandarg(argp, &arglist, EXP_FULL | EXP_TILDE); - for (sp = *spp; sp; sp = sp->next) + for (;;) { + find_command(arglist.list->text, &cmdentry, + cmd_flag | DO_REGBLTIN, pathval()); + + /* implement bltin and command here */ + if (cmdentry.cmdtype != CMDBUILTIN) + break; + + pseudovarflag = cmdentry.u.cmd->flags & BUILTIN_ASSIGN; + if (likely(spclbltin < 0)) { + spclblti...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Do not allocate stack string in padvance
...am.index; path = pathval(); do { - name = padvance(&path, cmdp->cmdname); - stunalloc(name); + padvance(&path, cmdp->cmdname); } while (--idx >= 0); + name = stackblock(); out1str(name); out1fmt(snlfmt, cmdp->rehash ? "*" : nullstr); } @@ -291,6 +290,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) int e; int updatetbl; struct builtincmd *bcmd; + int len; /* If name contains a slash, don't use PATH or hash table */ if (strchr(name, '/') != NULL) { @@ -362,8 +362,8 @@ find_command(char *name, struct cmdentry...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Replace with listsetvar with mklocal/setvareq
...= pushlocalvars(); file_stop = parsefile; back_exitstatus = 0; @@ -759,6 +760,8 @@ evalcommand(union node *cmd, int flags) cmd_flag = 0; execcmd = 0; spclbltin = -1; + vflags = 0; + vlocal = 0; path = NULL; argc = 0; @@ -770,6 +773,8 @@ evalcommand(union node *cmd, int flags) find_command(arglist.list->text, &cmdentry, cmd_flag | DO_REGBLTIN, pathval()); + vlocal++; + /* implement bltin and command here */ if (cmdentry.cmdtype != CMDBUILTIN) break; @@ -780,6 +785,7 @@ evalcommand(union node *cmd, int flags) cmdentry.u.cmd->flags &...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Never rehash regular built-ins
...mp;& builtinloc >= 0))) + if ((cmdp = cmdlookup(name, 0)) && + (cmdp->cmdtype == CMDNORMAL || + (cmdp->cmdtype == CMDBUILTIN && + !(cmdp->param.cmd->flags & BUILTIN_REGULAR) && + builtinloc > 0))) delete_cmd_entry(); find_command(name, &entry, DO_ERR, pathval()); if (entry.cmdtype == CMDUNKNOWN) @@ -377,7 +379,8 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) bit = DO_NOFUNC; break; case CMDBUILTIN: - bit = DO_ALTBLTIN; + bit = cmdp->param.cmd->flags & BUILTIN_R...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Stricter pathopt parsing
...*path = NULL; - return len; + strcpy(q, name); + + return qlen; } @@ -228,7 +273,7 @@ hashcmd(int argc, char **argv) char *name; while ((c = nextopt("r")) != '\0') { - clearcmdentry(0); + clearcmdentry(); return 0; } if (*argptr == NULL) { @@ -363,15 +408,16 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) idx = -1; loop: while ((len = padvance(&path, name)) >= 0) { + const char *lpathopt = pathopt; + fullname = stackblock(); idx++; - if (pathopt) { - if (prefix(pathopt, "builtin")) { + if (lpathopt) { +...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Fail immediately with redirections errors for simple command
...error. */ + if (spclbltin > 0) + exraise(EXERROR); + + goto out; + } + for (argp = cmd->ncmd.assign; argp; argp = argp->narg.next) { struct strlist **spp; @@ -848,30 +859,19 @@ evalcommand(union node *cmd, int flags) !(cmdentry.u.cmd->flags & BUILTIN_REGULAR)) { find_command(argv[0], &cmdentry, cmd_flag | DO_ERR, unlikely(path) ? path : pathval()); - if (cmdentry.cmdtype == CMDUNKNOWN) { - status = 127; -#ifdef FLUSHERR - flushout(&errout); -#endif - goto bail; - } - } - - if (status) { -bail: - exitstatus = status; - - /* We have a redirecti...
2012 Apr 17
2
[GIT PULL] elflink warning fixes and auto extension support
...".img", KT_FDIMAGE }, + { ".bss", KT_BSS }, + { ".bin", KT_BOOT }, + { ".bs", KT_BOOT }, + { ".0", KT_PXE }, + { NULL, KT_NONE }, +}; + +/* + * Return a pointer to one byte after the last character of the + * command. + */ +static inline const char *find_command(const char *str) +{ const char *p; - int len; - /* Find the end of the command */ - p = kernel; + p = str; while (*p && !my_isspace(*p)) p++; + return p; +} +static enum kernel_type parse_kernel_type(const char *kernel) +{ + const struct file_ext *ext; + const char *p; + int len;...
2012 May 04
3
[GIT PULL] elflink fixes
...\0'; + k[len + elen + strlen(p)] = '\0'; return k; } @@ -164,6 +164,12 @@ static void load_kernel(const char *command_line) if (!allowimplicit) goto bad_implicit; + /* Insert a null character to ignore any user-specified options */ + if (!allowoptions) { + char *p = (char *)find_command(kernel); + *p = '\0'; + } + type = parse_kernel_type(kernel); if (type == KT_KERNEL) { const char *ext; @@ -209,16 +215,12 @@ static void enter_cmdline(void) /* Enter endless command line prompt, should support "exit" */ while (1) { cmdline = edit_cmdline("sysl...
2012 Jul 16
5
[PATCH 0/5] Deleting __intcall() from Syslinux
From: Matt Fleming <matt.fleming at intel.com> Since we can't use __intcall() for EFI, and since we can now have the ELF module code resolve all our symbols at runtime, we should delete as many references to __intcall() as possible and just access the symbols directly. The most interesting patch is the support for weak symbols. We need to be able to reference derivative-specific
2012 Aug 14
1
[GIT PULL] elflink fixes
...", IMAGE_TYPE_COM32 }, + { ".img", IMAGE_TYPE_FDIMAGE }, + { ".bss", IMAGE_TYPE_BSS }, + { ".bin", IMAGE_TYPE_BOOT }, + { ".bs", IMAGE_TYPE_BOOT }, + { ".0", IMAGE_TYPE_PXE }, + { NULL, 0 }, }; /* @@ -45,7 +46,7 @@ static inline const char *find_command(const char *str) return p; } -enum kernel_type parse_kernel_type(const char *kernel) +uint32_t parse_image_type(const char *kernel) { const struct file_ext *ext; const char *p; @@ -62,8 +63,8 @@ enum kernel_type parse_kernel_type(const char *kernel) return ext->type; } - /* use...