search for: tblentry

Displaying 9 results from an estimated 9 matches for "tblentry".

Did you mean: rb_entry
2020 Mar 28
0
[klibc:update-dash] dash: exec: Stricter pathopt parsing
...c(len); diff --git a/usr/dash/exec.c b/usr/dash/exec.c index 04ee2ba9..8948754b 100644 --- a/usr/dash/exec.c +++ b/usr/dash/exec.c @@ -92,7 +92,7 @@ STATIC int builtinloc = -1; /* index in path of %builtin, or -1 */ STATIC void tryexec(char *, char **, char **); STATIC void printentry(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...
2017 Oct 18
1
uniform sampling without replacement algorithm
...mintblsize = 1.5 * k; tblsize = 32; while (tblsize < 0x80000000U && tblsize < mintblsize) tblsize <<= 1; unsigned tblmask = tblsize - 1; /* Allocate hash table, as auto variable if small, else with R_alloc. */ struct tblentry { int pos, val; } *tbl; struct tblentry local [ tblsize < 1000 ? tblsize : 1 ]; void *vmax = VMAXGET(); tbl = tblsize < 1000 ? local : (struct tblentry *) R_alloc(tblsize,sizeof *tbl); /* Clear all entries to zero. Non-empty pos v...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] command: allow combining -p with -v
...ecadent.org.uk> --- usr/dash/exec.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/usr/dash/exec.c b/usr/dash/exec.c index 79e20074..e56e3f67 100644 --- a/usr/dash/exec.c +++ b/usr/dash/exec.c @@ -96,7 +96,7 @@ STATIC void clearcmdentry(int); STATIC struct tblentry *cmdlookup(const char *, int); STATIC void delete_cmd_entry(void); STATIC void addcmdentry(char *, struct cmdentry *); -STATIC int describe_command(struct output *, char *, int); +STATIC int describe_command(struct output *, char *, const char *, int); /* @@ -727,21 +727,21 @@ typecmd(int ar...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] command: allow combining -p with -v
...ecadent.org.uk> --- usr/dash/exec.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/usr/dash/exec.c b/usr/dash/exec.c index 79e20074..e56e3f67 100644 --- a/usr/dash/exec.c +++ b/usr/dash/exec.c @@ -96,7 +96,7 @@ STATIC void clearcmdentry(int); STATIC struct tblentry *cmdlookup(const char *, int); STATIC void delete_cmd_entry(void); STATIC void addcmdentry(char *, struct cmdentry *); -STATIC int describe_command(struct output *, char *, int); +STATIC int describe_command(struct output *, char *, const char *, int); /* @@ -727,21 +727,21 @@ typecmd(int ar...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Small optimisation of command -pv change
...,7 +727,7 @@ typecmd(int argc, char **argv) int err = 0; for (i = 1; i < argc; i++) { - err |= describe_command(out1, argv[i], pathval(), 1); + err |= describe_command(out1, argv[i], NULL, 1); } return err; } @@ -743,6 +743,8 @@ describe_command(out, command, path, verbose) struct tblentry *cmdp; const struct alias *ap; + path = path ?: pathval(); + if (verbose) { outstr(command, out); } @@ -840,19 +842,19 @@ commandcmd(argc, argv) VERIFY_BRIEF = 1, VERIFY_VERBOSE = 2, } verify = 0; - const char *path = pathval(); + const char *path = NULL; while ((c = nextopt(...
2019 Jan 25
0
[klibc:update-dash] builtin: describe_command - fix incorrect path
....uk> --- usr/dash/exec.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/usr/dash/exec.c b/usr/dash/exec.c index ec0eadd8..e9e29b7e 100644 --- a/usr/dash/exec.c +++ b/usr/dash/exec.c @@ -743,8 +743,6 @@ describe_command(out, command, path, verbose) struct tblentry *cmdp; const struct alias *ap; - path = path ?: pathval(); - if (verbose) { outstr(command, out); } @@ -767,8 +765,17 @@ describe_command(out, command, path, verbose) goto out; } - /* Then check if it is a tracked alias */ - if ((cmdp = cmdlookup(command, 0)) != NULL) { + /* Then...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Small optimisation of command -pv change
...,7 +727,7 @@ typecmd(int argc, char **argv) int err = 0; for (i = 1; i < argc; i++) { - err |= describe_command(out1, argv[i], pathval(), 1); + err |= describe_command(out1, argv[i], NULL, 1); } return err; } @@ -743,6 +743,8 @@ describe_command(out, command, path, verbose) struct tblentry *cmdp; const struct alias *ap; + path = path ?: pathval(); + if (verbose) { outstr(command, out); } @@ -840,19 +842,19 @@ commandcmd(argc, argv) VERIFY_BRIEF = 1, VERIFY_VERBOSE = 2, } verify = 0; - const char *path = pathval(); + const char *path = NULL; while ((c = nextopt(...
2020 Mar 28
0
[klibc:update-dash] dash: builtin: describe_command - fix incorrect path
....uk> --- usr/dash/exec.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/usr/dash/exec.c b/usr/dash/exec.c index ec0eadd8..e9e29b7e 100644 --- a/usr/dash/exec.c +++ b/usr/dash/exec.c @@ -743,8 +743,6 @@ describe_command(out, command, path, verbose) struct tblentry *cmdp; const struct alias *ap; - path = path ?: pathval(); - if (verbose) { outstr(command, out); } @@ -767,8 +765,17 @@ describe_command(out, command, path, verbose) goto out; } - /* Then check if it is a tracked alias */ - if ((cmdp = cmdlookup(command, 0)) != NULL) { + /* Then...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Do not allocate stack string in padvance
...;%' ; p++); len = p - start + strlen(name) + 2; /* "2" is for '/' and '\0' */ @@ -211,7 +210,7 @@ padvance(const char **path, const char *name) *path = p + 1; else *path = NULL; - return stalloc(len); + return len; } @@ -266,9 +265,9 @@ printentry(struct tblentry *cmdp) idx = cmdp->param.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 ? "*" : nulls...