Displaying 18 results from an estimated 18 matches for "builtincmd".
Did you mean:
bltincmd
2019 Jan 25
0
[klibc:update-dash] builtin: create builtins.c properly on old cpp
...b/usr/dash/mkbuiltins
@@ -69,7 +69,7 @@ cat <<\!
#include "builtins.h"
!
-< $builtins sed '/^#/d; /^$/d' > $temp
+< $builtins sed '/^#/d; /^ *$/d' > $temp
awk '{ printf "int %s(int, char **);\n", $1}' $temp
echo '
const struct builtincmd builtincmd[] = {'
2020 Mar 28
0
[klibc:update-dash] dash: builtin: create builtins.c properly on old cpp
...b/usr/dash/mkbuiltins
@@ -69,7 +69,7 @@ cat <<\!
#include "builtins.h"
!
-< $builtins sed '/^#/d; /^$/d' > $temp
+< $builtins sed '/^#/d; /^ *$/d' > $temp
awk '{ printf "int %s(int, char **);\n", $1}' $temp
echo '
const struct builtincmd builtincmd[] = {'
2020 Mar 28
0
[klibc:update-dash] dash: exec: Do not allocate stack string in padvance
...dvance(&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 *entry, int act, const char *path)
e = ENOENT;
idx = -1;
loop:
- while ((fullname = padvance(&path,...
2019 Jan 25
0
[klibc:update-dash] builtin: Clear LC_ALL in mkbuiltins
...2 | nl -b a -v 0 | LC_COLLATE=C sort -u -k 3,3 |
-tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
+sed 's/ -[a-z]*//' $temp2 | nl -b a -v 0 |
+ LC_ALL= LC_COLLATE=C sort -u -k 3,3 |
+ tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
awk '{ printf "#define %s (builtincmd + %d)\n", $3, $1}'
printf '\n#define NUMBUILTINS %d\n' $(wc -l < $temp2)
echo '
2019 Jan 25
0
[klibc:update-dash] shell: Fix build on Solaris 9
...'};'
@@ -97,7 +101,7 @@ cat <<\!
*/
!
-sed 's/ -[a-z]*//' $temp2 | nl -b a -v 0 |
+sed 's/ -[a-z]*//' $temp2 | nl -ba -v0 |
LC_ALL= LC_COLLATE=C sort -u -k 3,3 |
tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
awk '{ printf "#define %s (builtincmd + %d)\n", $3, $1}'
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Clear LC_ALL in mkbuiltins
...2 | nl -b a -v 0 | LC_COLLATE=C sort -u -k 3,3 |
-tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
+sed 's/ -[a-z]*//' $temp2 | nl -b a -v 0 |
+ LC_ALL= LC_COLLATE=C sort -u -k 3,3 |
+ tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
awk '{ printf "#define %s (builtincmd + %d)\n", $3, $1}'
printf '\n#define NUMBUILTINS %d\n' $(wc -l < $temp2)
echo '
2020 Mar 28
0
[klibc:update-dash] dash: shell: Fix build on Solaris 9
...'};'
@@ -97,7 +101,7 @@ cat <<\!
*/
!
-sed 's/ -[a-z]*//' $temp2 | nl -b a -v 0 |
+sed 's/ -[a-z]*//' $temp2 | nl -ba -v0 |
LC_ALL= LC_COLLATE=C sort -u -k 3,3 |
tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
awk '{ printf "#define %s (builtincmd + %d)\n", $3, $1}'
2020 Mar 28
0
[klibc:update-dash] dash: eval: Report I/O error on stdout
...org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/eval.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 6652ccc0..01bc5234 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -952,6 +952,8 @@ evalbltin(const struct builtincmd *cmd, int argc, char **argv, int flags)
else
status = (*cmd->builtin)(argc, argv);
flushall();
+ if (outerr(out1))
+ warnx("%s: I/O error", commandname);
status |= outerr(out1);
exitstatus = status;
cmddone:
2020 Mar 28
0
[klibc:update-dash] dash: eval: Use sh_warnx instead of warnx
...ned-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/eval.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 4981f156..5074aa94 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -953,7 +953,7 @@ evalbltin(const struct builtincmd *cmd, int argc, char **argv, int flags)
status = (*cmd->builtin)(argc, argv);
flushall();
if (outerr(out1))
- warnx("%s: I/O error", commandname);
+ sh_warnx("%s: I/O error", commandname);
status |= outerr(out1);
exitstatus = status;
cmddone:
2020 Mar 28
0
[klibc:update-dash] dash: eval: Only restore exit status on exit/return
...define EXEXIT 4 /* exit the shell */
+#define EXEND 3 /* exit the shell */
+#define EXEXIT 4 /* exit the shell via exitcmd */
/*
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index bba0e7f8..1aad31a0 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -114,12 +114,13 @@ STATIC const struct builtincmd bltin = {
INCLUDE "eval.h"
EXITRESET {
- evalskip = 0;
- loopnest = 0;
if (savestatus >= 0) {
- exitstatus = savestatus;
+ if (exception == EXEXIT || evalskip == SKIPFUNCDEF)
+ exitstatus = savestatus;
savestatus = -1;
}
+ evalskip = 0;
+ loopnest = 0;
}
#endif
@@ -3...
2020 Mar 28
0
[klibc:update-dash] dash: mkinit: Split reset into exitreset and reset
...usr/dash/main.c | 4 +++-
usr/dash/mkinit.c | 8 ++++++++
usr/dash/redir.c | 2 +-
6 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 13e690e7..ff27ba9c 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -112,7 +112,7 @@ STATIC const struct builtincmd bltin = {
#ifdef mkinit
INCLUDE "eval.h"
-RESET {
+EXITRESET {
evalskip = 0;
loopnest = 0;
if (savestatus >= 0) {
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index 59a202cb..6ea0562f 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -1780,7 +1780,7 @@ varunset(...
2020 Nov 09
4
[[PATCH v1 0/3] Fix clang build warnings
New clangs emit some warnings. The code isn't wrong, but should be updated to
prevent warning creep.
Bill Wendling (3):
[klibc] dash: shell: Fix clang warnings
[klibc] dash: shell: Fix clang warnings about format string
[klibc] Kbuild: use an enum to silence a clang warning
usr/dash/eval.c | 6 +++---
usr/dash/jobs.c | 2 +-
usr/kinit/nfsmount/dummypmap.c
2020 Mar 27
2
[PATCH v2 5/5] Clean up clang warnings
...-
usr/kinit/ramdisk_load.c | 2 +-
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index ae83508ba160..2fa1a59995da 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -103,8 +103,8 @@ STATIC int bltincmd(int, char **);
STATIC const struct builtincmd bltin = {
- name: nullstr,
- builtin: bltincmd
+ .name = nullstr,
+ .builtin = bltincmd
};
@@ -274,7 +274,7 @@ checkexit:
n->nbinary.ch1,
(flags | ((isor >> 1) - 1)) & EV_TESTED
);
- if (!exitstatus == isor)
+ if ((!exitstatus) == isor)
break;
if (!evalskip) {...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Stricter pathopt parsing
...*/
void shellexec(char **, const char *, int)
__attribute__((__noreturn__));
-int padvance(const char **, const char *);
+int padvance_magic(const char **path, const char *name, int magic);
int hashcmd(int, char **);
void find_command(char *, struct cmdentry *, int, const char *);
struct builtincmd *find_builtin(const char *);
@@ -75,3 +75,8 @@ void defun(union node *);
void unsetfunc(const char *);
int typecmd(int, char **);
int commandcmd(int, char **);
+
+static inline int padvance(const char **path, const char *name)
+{
+ return padvance_magic(path, name, 1);
+}
diff --git a/usr/dash/m...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add assignment built-in support again
...arser.c | 3 +-
usr/dash/parser.h | 1 +
5 files changed, 97 insertions(+), 75 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index ff27ba9c..9e88fef2 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -100,8 +100,9 @@ STATIC int bltincmd(int, char **);
STATIC const struct builtincmd bltin = {
- name: nullstr,
- builtin: bltincmd
+ .name = nullstr,
+ .builtin = bltincmd,
+ .flags = BUILTIN_REGULAR,
};
@@ -648,22 +649,42 @@ out:
result->fd, result->buf, result->nleft, result->jp));
}
-static char **
-parse_command_args(char **argv, const char **path)
+stat...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...(union node *, int);
#ifdef notyet
-STATIC void evalcommand(union node *, int, struct backcmd *);
+STATIC int evalcommand(union node *, int, struct backcmd *);
#else
-STATIC void evalcommand(union node *, int);
+STATIC int evalcommand(union node *, int);
#endif
STATIC int evalbltin(const struct builtincmd *, int, char **, int);
STATIC int evalfun(struct funcnode *, int, char **, int);
@@ -170,11 +170,13 @@ evalstring(char *s, int flags)
setstackmark(&smark);
status = 0;
- while ((n = parsecmd(0)) != NEOF) {
- evaltree(n, flags & ~(parser_eof() ? 0 : EV_EXIT));
+ for (; (n = parsecmd(...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...(union node *, int);
#ifdef notyet
-STATIC void evalcommand(union node *, int, struct backcmd *);
+STATIC int evalcommand(union node *, int, struct backcmd *);
#else
-STATIC void evalcommand(union node *, int);
+STATIC int evalcommand(union node *, int);
#endif
STATIC int evalbltin(const struct builtincmd *, int, char **, int);
STATIC int evalfun(struct funcnode *, int, char **, int);
@@ -170,11 +170,13 @@ evalstring(char *s, int flags)
setstackmark(&smark);
status = 0;
- while ((n = parsecmd(0)) != NEOF) {
- evaltree(n, flags & ~(parser_eof() ? 0 : EV_EXIT));
+ for (; (n = parsecmd(...
2020 Mar 27
12
[PATCH 0/5] Clang compatibility patches
This is a series of patches for clang compatibility:
- Using flags needed flags and removing unsupported flags.
- Adding support for clang's LLD linker.
- Removing a variety of warnings.
Bill Wendling (3):
[klibc] Kbuild: use "libc.a" with clang
[klibc] Kbuild: Add "-fcommon" for clang builds
[klibc] Clean up clang warnings
Michael Davidson (1):
[klibc] Kbuild: