search for: popallfiles

Displaying 6 results from an estimated 6 matches for "popallfiles".

2019 Jan 25
0
[klibc:update-dash] eval: Restore input files in evalcommand
...sh/input.c index e53423c5..ae0c4c80 100644 --- a/usr/dash/input.c +++ b/usr/dash/input.c @@ -479,6 +479,13 @@ popfile(void) } +void unwindfiles(struct parsefile *stop) +{ + while (parsefile != stop) + popfile(); +} + + /* * Return to top level. */ @@ -486,8 +493,7 @@ popfile(void) void popallfiles(void) { - while (parsefile != &basepf) - popfile(); + unwindfiles(&basepf); } diff --git a/usr/dash/input.h b/usr/dash/input.h index ec97c1d6..a9c05174 100644 --- a/usr/dash/input.h +++ b/usr/dash/input.h @@ -97,5 +97,6 @@ void popstring(void); int setinputfile(const char *, int);...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Restore input files in evalcommand
...sh/input.c index e53423c5..ae0c4c80 100644 --- a/usr/dash/input.c +++ b/usr/dash/input.c @@ -479,6 +479,13 @@ popfile(void) } +void unwindfiles(struct parsefile *stop) +{ + while (parsefile != stop) + popfile(); +} + + /* * Return to top level. */ @@ -486,8 +493,7 @@ popfile(void) void popallfiles(void) { - while (parsefile != &basepf) - popfile(); + unwindfiles(&basepf); } diff --git a/usr/dash/input.h b/usr/dash/input.h index ec97c1d6..a9c05174 100644 --- a/usr/dash/input.h +++ b/usr/dash/input.h @@ -97,5 +97,6 @@ void popstring(void); int setinputfile(const char *, int);...
2019 Jan 25
0
[klibc:update-dash] [INPUT] Kill pgetc_macro
...2() { int c; do { - c = pgetc_macro(); + c = pgetc(); } while (c == PEOA); return c; } diff --git a/usr/dash/input.h b/usr/dash/input.h index 50a77971..775291b8 100644 --- a/usr/dash/input.h +++ b/usr/dash/input.h @@ -61,6 +61,3 @@ void setinputstring(char *); void popfile(void); void popallfiles(void); void closescript(void); - -#define pgetc_macro() \ - (--parsenleft >= 0 ? (signed char)*parsenextc++ : preadbuffer()) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index 572cbcd5..c4eaae2b 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -775,7 +775,7 @@ xxreadtoken(void)...
2020 Mar 28
0
[klibc:update-dash] dash: [INPUT] Kill pgetc_macro
...2() { int c; do { - c = pgetc_macro(); + c = pgetc(); } while (c == PEOA); return c; } diff --git a/usr/dash/input.h b/usr/dash/input.h index 50a77971..775291b8 100644 --- a/usr/dash/input.h +++ b/usr/dash/input.h @@ -61,6 +61,3 @@ void setinputstring(char *); void popfile(void); void popallfiles(void); void closescript(void); - -#define pgetc_macro() \ - (--parsenleft >= 0 ? (signed char)*parsenextc++ : preadbuffer()) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index 572cbcd5..c4eaae2b 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -775,7 +775,7 @@ xxreadtoken(void)...
2019 Jan 25
0
[klibc:update-dash] input: Move all input state into parsefile
...rsefile = &basepf; /* current input file */ @@ -114,10 +83,12 @@ INCLUDE "error.h" INIT { basepf.nextc = basepf.buf = basebuf; + basepf.linno = 1; } RESET { - parselleft = parsenleft = 0; /* clear input buffer */ + /* clear input buffer */ + basepf.lleft = basepf.nleft = 0; popallfiles(); } #endif @@ -131,8 +102,8 @@ RESET { int pgetc(void) { - if (--parsenleft >= 0) - return (signed char)*parsenextc++; + if (--parsefile->nleft >= 0) + return (signed char)*parsefile->nextc++; else return preadbuffer(); } @@ -158,7 +129,7 @@ preadfd(void) { int nr; ch...
2020 Mar 28
0
[klibc:update-dash] dash: input: Move all input state into parsefile
...rsefile = &basepf; /* current input file */ @@ -114,10 +83,12 @@ INCLUDE "error.h" INIT { basepf.nextc = basepf.buf = basebuf; + basepf.linno = 1; } RESET { - parselleft = parsenleft = 0; /* clear input buffer */ + /* clear input buffer */ + basepf.lleft = basepf.nleft = 0; popallfiles(); } #endif @@ -131,8 +102,8 @@ RESET { int pgetc(void) { - if (--parsenleft >= 0) - return (signed char)*parsenextc++; + if (--parsefile->nleft >= 0) + return (signed char)*parsefile->nextc++; else return preadbuffer(); } @@ -158,7 +129,7 @@ preadfd(void) { int nr; ch...