Displaying 8 results from an estimated 8 matches for "describe_command".
2019 Jan 25
0
[klibc:update-dash] builtin: describe_command - fix incorrect path
...rg/?p=libs/klibc/klibc.git;a=commit;h=4d9e71d139782c7bbd47285e7c38874965502e19
Author: Harald van Dijk <harald at gigawatt.nl>
AuthorDate: Fri, 26 May 2017 09:59:44 +0200
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Fri, 25 Jan 2019 02:57:21 +0000
[klibc] builtin: describe_command - fix incorrect path
Hi,
On 26/05/17 09:04, Youfu Zhang wrote:
> $ PATH=/extra/path:/usr/sbin:/usr/bin:/sbin:/bin \
>> sh -xc 'command -V ls; command -V ls; command -Vp ls; command -vp ls'
> + command -V ls
> ls is /bin/ls
> + command -V ls
> ls is a tracked alias for...
2020 Mar 28
0
[klibc:update-dash] dash: builtin: describe_command - fix incorrect path
...libs/klibc/klibc.git;a=commit;h=ae4ebb19df70ec73eb3ae9721762d40dd6bd3d1f
Author: Harald van Dijk <harald at gigawatt.nl>
AuthorDate: Fri, 26 May 2017 09:59:44 +0200
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 28 Mar 2020 21:42:54 +0000
[klibc] dash: builtin: describe_command - fix incorrect path
[ dash commit f19f3b398a2e947148a646096de94b77c73bb55d ]
Hi,
On 26/05/17 09:04, Youfu Zhang wrote:
> $ PATH=/extra/path:/usr/sbin:/usr/bin:/sbin:/bin \
>> sh -xc 'command -V ls; command -V ls; command -Vp ls; command -vp ls'
> + command -V ls
> ls is /...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] command: allow combining -p with -v
.../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 argc, char **argv)
int err = 0;
for (i = 1; i < argc; i++) {
- err |= describe_command(out1, argv[i], 1);
+ err |= describe_command(out1, arg...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] command: allow combining -p with -v
.../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 argc, char **argv)
int err = 0;
for (i = 1; i < argc; i++) {
- err |= describe_command(out1, argv[i], 1);
+ err |= describe_command(out1, arg...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Small optimisation of command -pv change
...Herbert Xu <herbert at gondor.apana.org.au>
AuthorDate: Fri, 26 Sep 2014 16:47:25 +0800
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Fri, 25 Jan 2019 02:57:21 +0000
[klibc] [BUILTIN] Small optimisation of command -pv change
This patch moves the pathval call into the describe_command
function and also eliminates an unnecessary branch when DEBUG
is off.
Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/exec.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Small optimisation of command -pv change
...ri, 26 Sep 2014 16:47:25 +0800
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 28 Mar 2020 21:42:54 +0000
[klibc] dash: [BUILTIN] Small optimisation of command -pv change
[ dash commit 29ee27dda68a63ce8b9dccdf2c86f75a4d754b5c ]
This patch moves the pathval call into the describe_command
function and also eliminates an unnecessary branch when DEBUG
is off.
Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/exec.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Do not allocate stack string in padvance
...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);
} while (--j >= 0);
+ p = stackblock();
}
if (verbose) {
outfmt(
diff --git a/usr/dash/exec.h b/usr/dash/exec.h
index 9c...
2007 Aug 23
0
[git patch] klibc dash 0.5.4 update
...ash/exec.c
index 417ba8a..c55683d 100644
--- a/usr/dash/exec.c
+++ b/usr/dash/exec.c
@@ -846,6 +846,7 @@ commandcmd(argc, argv)
int argc;
char **argv;
{
+ char *cmd;
int c;
enum {
VERIFY_BRIEF = 1,
@@ -862,8 +863,9 @@ commandcmd(argc, argv)
abort();
#endif
- if (verify)
- return describe_command(out1, *argptr, verify - VERIFY_BRIEF);
+ cmd = *argptr;
+ if (verify && cmd)
+ return describe_command(out1, cmd, verify - VERIFY_BRIEF);
return 0;
}
commit 53eaa866587754cb7054eb1b953adea04cf3a4df
Author: Alexey Gladkov <legion at altlinux.org>
Date: Fri Oct 13 22:58:46 2006...