search for: cmdloop

Displaying 14 results from an estimated 14 matches for "cmdloop".

Did you mean: cmd_noop
2019 Jan 25
0
[klibc:update-dash] eval: Fix exit status when calling eval/dot with no commands
...e exit status, and the fix you link to doesn't handle this because it sees a command has been executed and saves the exit status after executing that command as the exit status to be used by ".". I think the easiest way to fix this is to prevent null commands from affecting status in cmdloop, as attached. An alternative could be to change the outer if condition to exclude n == NULL, but I didn't do that because the change of job_warning and clearing of numeof make sense to me even for null commands. Besides, when debug tracing is enabled, null commands have a visible effect that s...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Fix exit status when calling eval/dot with no commands
...e exit status, and the fix you link to doesn't handle this because it sees a command has been executed and saves the exit status after executing that command as the exit status to be used by ".". I think the easiest way to fix this is to prevent null commands from affecting status in cmdloop, as attached. An alternative could be to change the outer if condition to exclude n == NULL, but I didn't do that because the change of job_warning and clearing of numeof make sense to me even for null commands. Besides, when debug tracing is enabled, null commands have a visible effect that s...
2019 Jan 25
0
[klibc:update-dash] input: Remove HETIO
...a/usr/dash/main.c b/usr/dash/main.c index 985e8c4e..bedb6635 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -60,10 +60,6 @@ #include "exec.h" #include "cd.h" -#ifdef HETIO -#include "hetio.h" -#endif - #define PROFILE 0 int rootpid; @@ -206,10 +202,6 @@ cmdloop(int top) int numeof = 0; TRACE(("cmdloop(%d) called\n", top)); -#ifdef HETIO - if(iflag && top) - hetio_init(); -#endif for (;;) { int skip; diff --git a/usr/dash/trap.c b/usr/dash/trap.c index b8470437..a6997d4f 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@...
2020 Mar 28
0
[klibc:update-dash] dash: input: Remove HETIO
...a/usr/dash/main.c b/usr/dash/main.c index 985e8c4e..bedb6635 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -60,10 +60,6 @@ #include "exec.h" #include "cd.h" -#ifdef HETIO -#include "hetio.h" -#endif - #define PROFILE 0 int rootpid; @@ -206,10 +202,6 @@ cmdloop(int top) int numeof = 0; TRACE(("cmdloop(%d) called\n", top)); -#ifdef HETIO - if(iflag && top) - hetio_init(); -#endif for (;;) { int skip; diff --git a/usr/dash/trap.c b/usr/dash/trap.c index b8470437..a6997d4f 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle -- in dotcmd
...tatus = 0; - if (argc >= 2) { /* That's what SVR2 does */ + nextopt(nullstr); + argv = argptr; + + if (*argv) { char *fullname; - fullname = find_dot_file(argv[1]); + fullname = find_dot_file(*argv); setinputfile(fullname, INPUT_PUSH_FILE); commandname = fullname; status = cmdloop(0); popfile(); } + return status; }
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle -- in dotcmd
...tatus = 0; - if (argc >= 2) { /* That's what SVR2 does */ + nextopt(nullstr); + argv = argptr; + + if (*argv) { char *fullname; - fullname = find_dot_file(argv[1]); + fullname = find_dot_file(*argv); setinputfile(fullname, INPUT_PUSH_FILE); commandname = fullname; status = cmdloop(0); popfile(); } + return status; }
2020 Mar 28
0
[klibc:update-dash] dash: main: Print \n upon EOF (CTRL-D) when run interactively
...org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr/dash/main.c b/usr/dash/main.c index e8e42565..6d53e009 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -221,8 +221,15 @@ cmdloop(int top) if (!top || numeof >= 50) break; if (!stoppedjobs()) { - if (!Iflag) + if (!Iflag) { + if (iflag) { + out2c('\n'); +#ifdef FLUSHERR + flushout(out2); +#endif + } break; + } out2str("\nUse \"exit\" to leave shell.\...
2012 Jul 02
0
[klibc:master] [BUILTIN] Merge SKIPFUNC/ SKIPFILE and only clear SKIPFUNC when leaving dotcmd
...3 @@ extern int evalskip; #define SKIPBREAK (1 << 0) #define SKIPCONT (1 << 1) #define SKIPFUNC (1 << 2) -#define SKIPFILE (1 << 3) diff --git a/usr/dash/main.c b/usr/dash/main.c index b38dc27..7df3c44 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -242,7 +242,7 @@ cmdloop(int top) skip = evalskip; if (skip) { - evalskip = 0; + evalskip &= ~SKIPFUNC; break; } }
2012 Oct 01
0
[klibc:master] Avoid overflow for very long variable name
...irstc=118, syntax=0x419522 "", eofmark=0x0, striptabs=0) at parser.c:1040 #9 0x00000000004101a4 in xxreadtoken () at parser.c:826 #10 0x000000000040fe1d in readtoken () at parser.c:697 #11 0x000000000040edcc in parsecmd (interact=0) at parser.c:145 #12 0x000000000040c679 in cmdloop (top=1) at main.c:224 #13 0x000000000040c603 in main (argc=2, argv=0x7fffffffd9f8) at main.c:178 #8 0x00000000004106b5 in readtoken1 (firstc=118, syntax=0x419522 "", eofmark=0x0, striptabs=0) at parser.c:1040 1040 grabstackblock(len); (gdb) p len $30 = -2147483644 Si...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Return without arguments in a trap should use status outside traps
...extern int evalskip; #define SKIPBREAK (1 << 0) #define SKIPCONT (1 << 1) #define SKIPFUNC (1 << 2) +#define SKIPFUNCDEF (1 << 3) diff --git a/usr/dash/main.c b/usr/dash/main.c index 29a258d3..00c5e00d 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -242,7 +242,7 @@ cmdloop(int top) skip = evalskip; if (skip) { - evalskip &= ~SKIPFUNC; + evalskip &= ~(SKIPFUNC | SKIPFUNCDEF); break; } } diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 7dd8342f..b8470437 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -342,7 +342,8 @@ void dotrap(...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Return without arguments in a trap should use status outside traps
...extern int evalskip; #define SKIPBREAK (1 << 0) #define SKIPCONT (1 << 1) #define SKIPFUNC (1 << 2) +#define SKIPFUNCDEF (1 << 3) diff --git a/usr/dash/main.c b/usr/dash/main.c index 29a258d3..00c5e00d 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -242,7 +242,7 @@ cmdloop(int top) skip = evalskip; if (skip) { - evalskip &= ~SKIPFUNC; + evalskip &= ~(SKIPFUNC | SKIPFUNCDEF); break; } } diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 7dd8342f..b8470437 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -342,7 +342,8 @@ void dotrap(...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Fix old-style command substitution here-document crash
...gt; #10 0x5322f7 in expandarg /home/jfe/dash/src/expand.c:196:2 > #11 0x528118 in fill_arglist /home/jfe/dash/src/eval.c:659:3 > #12 0x5213b6 in evalcommand /home/jfe/dash/src/eval.c:769:13 > #13 0x520010 in evaltree /home/jfe/dash/src/eval.c:288:12 > #14 0x554423 in cmdloop /home/jfe/dash/src/main.c:234:8 > #15 0x553bcc in main /home/jfe/dash/src/main.c:176:3 > #16 0x7f201c2b2a86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21a86) > #17 0x41dfb9 in _start (/home/jfe/dash/src/dash+0x41dfb9) > > AddressSanitizer can not provide addi...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...ansi C */ -void evaltree(union node *, int); +int evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); extern int evalskip; diff --git a/usr/dash/main.c b/usr/dash/main.c index 497ac160..fcd3e7d2 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -225,11 +225,13 @@ cmdloop(int top) } numeof++; } else if (nflag == 0) { + int i; + job_warning = (job_warning == 2) ? 1 : 0; numeof = 0; - evaltree(n, 0); + i = evaltree(n, 0); if (n) - status = exitstatus; + status = i; } popstackmark(&smark);
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...ansi C */ -void evaltree(union node *, int); +int evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); extern int evalskip; diff --git a/usr/dash/main.c b/usr/dash/main.c index 497ac160..fcd3e7d2 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -225,11 +225,13 @@ cmdloop(int top) } numeof++; } else if (nflag == 0) { + int i; + job_warning = (job_warning == 2) ? 1 : 0; numeof = 0; - evaltree(n, 0); + i = evaltree(n, 0); if (n) - status = exitstatus; + status = i; } popstackmark(&smark);