Displaying 20 results from an estimated 20 matches for "ev_test".
Did you mean:
ov_test
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...union node *, int);
+ int (*evalfn)(union node *, int);
unsigned isor;
- int status;
+ int status = 0;
if (n == NULL) {
TRACE(("evaltree(NULL) called\n"));
goto out;
@@ -221,8 +223,7 @@ evaltree(union node *n, int flags)
break;
#endif
case NNOT:
- evaltree(n->nnot.com, EV_TESTED);
- status = !exitstatus;
+ status = !evaltree(n->nnot.com, EV_TESTED);
goto setstatus;
case NREDIR:
errlinno = lineno = n->nredir.linno;
@@ -230,11 +231,8 @@ evaltree(union node *n, int flags)
lineno -= funcline - 1;
expredir(n->nredir.redirect);
pushredir(n->nred...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...union node *, int);
+ int (*evalfn)(union node *, int);
unsigned isor;
- int status;
+ int status = 0;
if (n == NULL) {
TRACE(("evaltree(NULL) called\n"));
goto out;
@@ -221,8 +223,7 @@ evaltree(union node *n, int flags)
break;
#endif
case NNOT:
- evaltree(n->nnot.com, EV_TESTED);
- status = !exitstatus;
+ status = !evaltree(n->nnot.com, EV_TESTED);
goto setstatus;
case NREDIR:
errlinno = lineno = n->nredir.linno;
@@ -230,11 +231,8 @@ evaltree(union node *n, int flags)
lineno -= funcline - 1;
expredir(n->nredir.redirect);
pushredir(n->nred...
2019 Jan 25
0
[klibc:update-dash] [EVAL] Move common skipcount logic into skiploop
...break;
+
+ case SKIPBREAK:
+ case SKIPCONT:
+ if (likely(--skipcount <= 0)) {
+ evalskip = 0;
+ break;
+ }
+
+ skip = SKIPBREAK;
+ break;
+ }
+
+ return skip;
+}
+
+
STATIC void
evalloop(union node *n, int flags)
{
+ int skip;
int status;
loopnest++;
status = 0;
flags &= EV_TESTED;
- for (;;) {
+ do {
int i;
evaltree(n->nbinary.ch1, EV_TESTED);
- if (evalskip) {
-skipping: if (evalskip == SKIPCONT && --skipcount <= 0) {
- evalskip = 0;
- continue;
- }
- if (evalskip == SKIPBREAK && --skipcount <= 0)
- evalskip = 0;
- break...
2020 Mar 28
0
[klibc:update-dash] dash: [EVAL] Move common skipcount logic into skiploop
...break;
+
+ case SKIPBREAK:
+ case SKIPCONT:
+ if (likely(--skipcount <= 0)) {
+ evalskip = 0;
+ break;
+ }
+
+ skip = SKIPBREAK;
+ break;
+ }
+
+ return skip;
+}
+
+
STATIC void
evalloop(union node *n, int flags)
{
+ int skip;
int status;
loopnest++;
status = 0;
flags &= EV_TESTED;
- for (;;) {
+ do {
int i;
evaltree(n->nbinary.ch1, EV_TESTED);
- if (evalskip) {
-skipping: if (evalskip == SKIPCONT && --skipcount <= 0) {
- evalskip = 0;
- continue;
- }
- if (evalskip == SKIPBREAK && --skipcount <= 0)
- evalskip = 0;
- break...
2020 Jun 18
1
[PATCH] fix warnings with GCC 10
...++++++++++++++++++
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index dd144948a9fa..6b2b01e19a47 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -274,7 +274,7 @@ checkexit:
n->nbinary.ch1,
(flags | ((isor >> 1) - 1)) & EV_TESTED
);
- if (!exitstatus == isor)
+ if ((!exitstatus) == isor)
break;
if (!evalskip) {
n = n->nbinary.ch2;
diff --git a/usr/klibc/zlib/infback.c b/usr/klibc/zlib/infback.c
index 455dbc9ee843..be5eace3ad1a 100644
--- a/usr/klibc/zlib/infback.c
+++ b/usr/klibc/zlib/infback.c
@@ -460,...
2019 Jan 25
0
[klibc:update-dash] [SHELL] Optimize dash -c "command" to avoid a fork
...nch:
1) Generate patch and fix up their path
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index ae83508b..da39136d 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -65,10 +65,6 @@
#endif
-/* flags in argument to evaltree */
-#define EV_EXIT 01 /* exit after evaluating tree */
-#define EV_TESTED 02 /* exit status is checked; ignore -e flag */
-
int evalskip; /* set if we are skipping commands */
STATIC int skipcount; /* number of levels to skip */
MKINIT int loopnest; /* current loop nesting level */
@@ -169,7 +165,7 @@ evalstring(char *s, int flags)
status = 0;
while ((n =...
2020 Mar 28
0
[klibc:update-dash] dash: [SHELL] Optimize dash -c "command" to avoid a fork
...Several changes have been made for klibc:
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index dd144948..e6f6cd5c 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -65,10 +65,6 @@
#endif
-/* flags in argument to evaltree */
-#define EV_EXIT 01 /* exit after evaluating tree */
-#define EV_TESTED 02 /* exit status is checked; ignore -e flag */
-
int evalskip; /* set if we are skipping commands */
STATIC int skipcount; /* number of levels to skip */
MKINIT int loopnest; /* current loop nesting level */
@@ -169,7 +165,7 @@ evalstring(char *s, int flags)
status = 0;
while ((n =...
2019 Jan 25
0
[klibc:update-dash] [PATCH] eval: Silence compiler warning about missing parentheses
...insertion(+), 1 deletion(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 56661880..cecd41c1 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -278,7 +278,7 @@ checkexit:
isor = n->type - NAND;
status = evaltree(n->nbinary.ch1,
(flags | ((isor >> 1) - 1)) & EV_TESTED);
- if (!status == isor || evalskip)
+ if ((!status) == isor || evalskip)
break;
n = n->nbinary.ch2;
evaln:
2020 Mar 28
0
[klibc:update-dash] dash: eval: Silence compiler warning about missing parentheses
...insertion(+), 1 deletion(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 09a5cbf1..dc0c9fa2 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -279,7 +279,7 @@ checkexit:
isor = n->type - NAND;
status = evaltree(n->nbinary.ch1,
(flags | ((isor >> 1) - 1)) & EV_TESTED);
- if (!status == isor || evalskip)
+ if ((!status) == isor || evalskip)
break;
n = n->nbinary.ch2;
evaln:
2019 Jan 25
0
[klibc:update-dash] eval: Variable assignments on functions are no longer persistent
...evalfun(cmdentry.u.func, argc, argv, flags))
goto raise;
break;
@@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
shellparam.p = argv + 1;
shellparam.optind = 1;
shellparam.optoff = -1;
- pushlocalvars();
evaltree(func->n.ndefun.body, flags & EV_TESTED);
- poplocalvars(0);
funcdone:
INTOFF;
loopnest = saveloopnest;
2020 Mar 28
0
[klibc:update-dash] dash: eval: Variable assignments on functions are no longer persistent
...evalfun(cmdentry.u.func, argc, argv, flags))
goto raise;
break;
@@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
shellparam.p = argv + 1;
shellparam.optind = 1;
shellparam.optoff = -1;
- pushlocalvars();
evaltree(func->n.ndefun.body, flags & EV_TESTED);
- poplocalvars(0);
funcdone:
INTOFF;
loopnest = saveloopnest;
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reset handler when entering a subshell
...usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -41,6 +41,7 @@
* Evaluate a command.
*/
+#include "main.h"
#include "shell.h"
#include "nodes.h"
#include "syntax.h"
@@ -492,6 +493,7 @@ evalsubshell(union node *n, int flags)
if (backgnd)
flags &=~ EV_TESTED;
nofork:
+ reset_handler();
redirect(n->nredir.redirect, 0);
evaltreenr(n->nredir.n, flags);
/* never returns */
@@ -574,6 +576,7 @@ evalpipe(union node *n, int flags)
}
}
if (forkshell(jp, lp->n, n->npipe.backgnd) == 0) {
+ reset_handler();
INTON;
if (p...
2012 Jul 02
0
[klibc:master] [EVAL] Remove unused EV_BACKCMD flag
...-------
1 files changed, 19 insertions(+), 45 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 26302a7..d675ba7 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -68,7 +68,6 @@
/* flags in argument to evaltree */
#define EV_EXIT 01 /* exit after evaluating tree */
#define EV_TESTED 02 /* exit status is checked; ignore -e flag */
-#define EV_BACKCMD 04 /* command executing within back quotes */
int evalskip; /* set if we are skipping commands */
STATIC int skipcount; /* number of levels to skip */
@@ -594,6 +593,9 @@ evalpipe(union node *n, int flags)
void
evalbac...
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
2010 Mar 22
1
[git pull] dash, sh4, README's
...derr when /dev/tty fails to open
[klibc] [PARSER] Allow newlines after var name in for statements
[klibc] [PARSER] Use CHKNL to parse case statements
[klibc] [REDIR] Fix incorrect savefd conversions
[klibc] [EXPAND] Fix quoted pattern patch breakage
[klibc] [EVAL] Pass EV_TESTED into evalcmd
[klibc] [EVAL] Revert SKIPEVAL into EXEXIT
[klibc] [BUILTIN] Fix NUL termination in readcmd
[klibc] [CD] Lookup PWD after going through CDPATH
[klibc] [BUILTIN] Fix off-by-one recordregion in readcmd
[klibc] [ARITH] Fix binary operator parsing
[kli...
2020 Mar 27
2
[PATCH v2 5/5] Clean up clang warnings
...sr/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) {
n = n->nbinary.ch2;
@@ -1081,7 +1081,7 @@ eprintlist(struct output *out, struct strlist *sp, int sep)
while (sp) {
const char *p;
- p = " %s" + (1 - sep);
+ p = &" %s&...
2010 Apr 16
0
[git pull v4] dash, sh4, ipconfig, dprintf, fstype, README's
...derr when /dev/tty fails to open
[klibc] [PARSER] Allow newlines after var name in for statements
[klibc] [PARSER] Use CHKNL to parse case statements
[klibc] [REDIR] Fix incorrect savefd conversions
[klibc] [EXPAND] Fix quoted pattern patch breakage
[klibc] [EVAL] Pass EV_TESTED into evalcmd
[klibc] [EVAL] Revert SKIPEVAL into EXEXIT
[klibc] [BUILTIN] Fix NUL termination in readcmd
[klibc] [CD] Lookup PWD after going through CDPATH
[klibc] [BUILTIN] Fix off-by-one recordregion in readcmd
[klibc] [ARITH] Fix binary operator parsing
[kli...
2010 Apr 16
0
[PATCH] pull faccessat() system call
...derr when /dev/tty fails to open
[klibc] [PARSER] Allow newlines after var name in for statements
[klibc] [PARSER] Use CHKNL to parse case statements
[klibc] [REDIR] Fix incorrect savefd conversions
[klibc] [EXPAND] Fix quoted pattern patch breakage
[klibc] [EVAL] Pass EV_TESTED into evalcmd
[klibc] [EVAL] Revert SKIPEVAL into EXEXIT
[klibc] [BUILTIN] Fix NUL termination in readcmd
[klibc] [CD] Lookup PWD after going through CDPATH
[klibc] [BUILTIN] Fix off-by-one recordregion in readcmd
[klibc] [ARITH] Fix binary operator parsing
[kli...
2010 Mar 28
1
[git pull v3] dash, sh4, ipconfig, dprintf, fstype, README's
...derr when /dev/tty fails to open
[klibc] [PARSER] Allow newlines after var name in for statements
[klibc] [PARSER] Use CHKNL to parse case statements
[klibc] [REDIR] Fix incorrect savefd conversions
[klibc] [EXPAND] Fix quoted pattern patch breakage
[klibc] [EVAL] Pass EV_TESTED into evalcmd
[klibc] [EVAL] Revert SKIPEVAL into EXEXIT
[klibc] [BUILTIN] Fix NUL termination in readcmd
[klibc] [CD] Lookup PWD after going through CDPATH
[klibc] [BUILTIN] Fix off-by-one recordregion in readcmd
[klibc] [ARITH] Fix binary operator parsing
[kli...
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: