summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2017-02-27 07:48:45 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2017-02-27 07:48:45 (GMT)
commitf6e929c8f623c801aafb3c47011df66bc9ffe440 (patch) (side-by-side diff)
tree8c7b576922948aab56ab6aadd730ab26674267da
parentfafe2d8d6eecd2272aabe65bdfff9d704c8548b7 (diff)
downloadjumper-f6e929c8f623c801aafb3c47011df66bc9ffe440.tar.gz
jumper-f6e929c8f623c801aafb3c47011df66bc9ffe440.tar.bz2
Minor fix in scanner
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--extra/lex.l6
1 files changed, 4 insertions, 2 deletions
diff --git a/extra/lex.l b/extra/lex.l
index 2023439..45dde56 100644
--- a/extra/lex.l
+++ b/extra/lex.l
@@ -26,11 +26,13 @@ fillbuf(char *buf, size_t max_size)
if (!*lex_curp) {
if (lex_argi == lex_argc)
break;
+ if (lex_argi)
+ buf[consumed++] = ' ';
lex_curp = lex_argv[lex_argi++];
}
n = strlen(lex_curp);
- if (n > max_size)
- n = max_size;
+ if (n > max_size - consumed)
+ n = max_size - consumed;
memcpy(buf + consumed, lex_curp, n);
lex_curp += n;
consumed += n;

Return to:

Send suggestions and report system problems to the System administrator.