search for: lastc

Displaying 2 results from an estimated 2 matches for "lastc".

Did you mean: last
2019 Jan 25
0
[klibc:update-dash] input: Allow two consecutive calls to pungetc
...+++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/usr/dash/input.c b/usr/dash/input.c index 6223a735..06c08d49 100644 --- a/usr/dash/input.c +++ b/usr/dash/input.c @@ -102,10 +102,20 @@ RESET { int pgetc(void) { + int c; + + if (parsefile->unget) + return parsefile->lastc[--parsefile->unget]; + if (--parsefile->nleft >= 0) - return (signed char)*parsefile->nextc++; + c = (signed char)*parsefile->nextc++; else - return preadbuffer(); + c = preadbuffer(); + + parsefile->lastc[1] = parsefile->lastc[0]; + parsefile->lastc[0] = c; + + retu...
2020 Mar 28
0
[klibc:update-dash] dash: input: Allow two consecutive calls to pungetc
...+++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/usr/dash/input.c b/usr/dash/input.c index 6223a735..06c08d49 100644 --- a/usr/dash/input.c +++ b/usr/dash/input.c @@ -102,10 +102,20 @@ RESET { int pgetc(void) { + int c; + + if (parsefile->unget) + return parsefile->lastc[--parsefile->unget]; + if (--parsefile->nleft >= 0) - return (signed char)*parsefile->nextc++; + c = (signed char)*parsefile->nextc++; else - return preadbuffer(); + c = preadbuffer(); + + parsefile->lastc[1] = parsefile->lastc[0]; + parsefile->lastc[0] = c; + + retu...