-/* $OpenBSD: parse.y,v 1.23 2020/10/15 19:42:56 naddy Exp $ */
+/* $OpenBSD: parse.y,v 1.24 2021/10/15 15:01:27 naddy Exp $ */
/*
* Copyright (c) 2006 Bob Beck <beck@openbsd.org>
#define MAXPUSHBACK 128
-u_char *parsebuf;
+char *parsebuf;
int parseindex;
-u_char pushback_buffer[MAXPUSHBACK];
+char pushback_buffer[MAXPUSHBACK];
int pushback_index = 0;
int
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
int
yylex(void)
{
- u_char buf[8096];
- u_char *p;
+ char buf[8096];
+ char *p;
int quotec, next, c;
int token;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.4 2021/09/20 11:46:22 florian Exp $ */
+/* $OpenBSD: parse.y,v 1.5 2021/10/15 15:01:27 naddy Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
int
yylex(void)
{
- unsigned char buf[8096];
- unsigned char *p, *val;
- int quotec, next, c;
- int token;
+ char buf[8096];
+ char *p, *val;
+ int quotec, next, c;
+ int token;
top:
p = buf;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.133 2021/10/12 09:27:21 tobhe Exp $ */
+/* $OpenBSD: parse.y,v 1.134 2021/10/15 15:01:27 naddy Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
int
yylex(void)
{
- unsigned char buf[8096];
- unsigned char *p, *val;
- int quotec, next, c;
- int token;
+ char buf[8096];
+ char *p, *val;
+ int quotec, next, c;
+ int token;
top:
p = buf;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.179 2020/12/29 19:50:03 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.180 2021/10/15 15:01:27 naddy Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
#define MAXPUSHBACK 128
-u_char *parsebuf;
+char *parsebuf;
int parseindex;
-u_char pushback_buffer[MAXPUSHBACK];
+char pushback_buffer[MAXPUSHBACK];
int pushback_index = 0;
int
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
/* skip to either EOF or the first real EOL */
while (1) {
if (pushback_index)
- c = pushback_buffer[--pushback_index];
+ c = (unsigned char)pushback_buffer[--pushback_index];
else
c = lgetc(0);
if (c == '\n') {
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.709 2021/02/01 00:31:04 dlg Exp $ */
+/* $OpenBSD: parse.y,v 1.710 2021/10/15 15:01:27 naddy Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.27 2021/08/31 20:18:03 kn Exp $ */
+/* $OpenBSD: parse.y,v 1.28 2021/10/15 15:01:27 naddy Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
int
yylex(void)
{
- unsigned char buf[8096];
- unsigned char *p, *val;
- int quotec, next, c;
- int token;
+ char buf[8096];
+ char *p, *val;
+ int quotec, next, c;
+ int token;
top:
p = buf;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.42 2020/09/14 16:00:17 florian Exp $ */
+/* $OpenBSD: parse.y,v 1.43 2021/10/15 15:01:27 naddy Exp $ */
/*
* Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return c;
}
-/* $OpenBSD: parse.y,v 1.419 2021/09/01 12:39:52 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.420 2021/10/15 15:01:27 naddy Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.39 2019/02/13 22:57:08 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.40 2021/10/15 15:01:27 naddy Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org>
#define MAXPUSHBACK 128
-u_char *parsebuf;
+char *parsebuf;
int parseindex;
-u_char pushback_buffer[MAXPUSHBACK];
+char pushback_buffer[MAXPUSHBACK];
int pushback_index = 0;
int
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
/* skip to either EOF or the first real EOL */
while (1) {
if (pushback_index)
- c = pushback_buffer[--pushback_index];
+ c = (unsigned char)pushback_buffer[--pushback_index];
else
c = lgetc(0);
if (c == '\n') {
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.31 2020/12/30 18:39:57 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.32 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
static int
yylex(void)
{
- unsigned char buf[8096];
- unsigned char *p, *val;
- int quotec, next, c;
- int token;
+ char buf[8096];
+ char *p, *val;
+ int quotec, next, c;
+ int token;
top:
p = buf;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.61 2019/05/10 01:29:31 guenther Exp $ */
+/* $OpenBSD: parse.y,v 1.62 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Reyk Floeter <reyk@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.125 2021/04/10 10:10:07 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.126 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2020 Matthias Pressfreund <mpfr@fn.de>
int
yylex(void)
{
- unsigned char buf[8096];
- unsigned char *p, *val;
- int quotec, next, c;
- int token;
+ char buf[8096];
+ char *p, *val;
+ int quotec, next, c;
+ int token;
top:
p = buf;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.55 2019/02/13 22:57:08 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.56 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2004 Ryan McBride <mcbride@openbsd.org>
#define MAXPUSHBACK 128
-u_char *parsebuf;
+char *parsebuf;
int parseindex;
-u_char pushback_buffer[MAXPUSHBACK];
+char pushback_buffer[MAXPUSHBACK];
int pushback_index = 0;
int
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
/* skip to either EOF or the first real EOL */
while (1) {
if (pushback_index)
- c = pushback_buffer[--pushback_index];
+ c = (unsigned char)pushback_buffer[--pushback_index];
else
c = lgetc(0);
if (c == '\n') {
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.18 2019/02/13 22:57:08 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.19 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.42 2021/10/07 11:35:30 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.43 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martinh@openbsd.org>
int
yylex(void)
{
- u_char buf[4096];
- u_char *p, *val;
+ char buf[4096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.23 2021/01/30 19:32:44 kn Exp $ */
+/* $OpenBSD: parse.y,v 1.24 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2012 Mark Kettenis <kettenis@openbsd.org>
#define MAXPUSHBACK 128
-u_char *parsebuf;
+char *parsebuf;
int parseindex;
-u_char pushback_buffer[MAXPUSHBACK];
+char pushback_buffer[MAXPUSHBACK];
int pushback_index = 0;
int
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
/* skip to either EOF or the first real EOL */
while (1) {
if (pushback_index)
- c = pushback_buffer[--pushback_index];
+ c = (unsigned char)pushback_buffer[--pushback_index];
else
c = lgetc(0);
if (c == '\n') {
int
yylex(void)
{
- u_char buf[8096];
- u_char *p;
+ char buf[8096];
+ char *p;
int quotec, next, c;
int token;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.71 2019/02/13 22:57:08 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.72 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2013, 2015, 2016 Renato Westphal <renato@openbsd.org>
static int
yylex(void)
{
- unsigned char buf[8096];
- unsigned char *p, *val;
- int quotec, next, c;
- int token;
+ char buf[8096];
+ char *p, *val;
+ int quotec, next, c;
+ int token;
top:
p = buf;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.7 2019/06/28 13:32:48 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.8 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
#define MAXPUSHBACK 128
-unsigned char *parsebuf;
-int parseindex;
-unsigned char pushback_buffer[MAXPUSHBACK];
-int pushback_index = 0;
+char *parsebuf;
+int parseindex;
+char pushback_buffer[MAXPUSHBACK];
+int pushback_index = 0;
int
lgetc(int quotec)
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
int
yylex(void)
{
- unsigned char buf[8096];
- unsigned char *p, *val;
- int quotec, next, c;
- int token;
+ char buf[8096];
+ char *p, *val;
+ int quotec, next, c;
+ int token;
top:
p = buf;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.24 2019/02/27 04:52:19 denis Exp $ */
+/* $OpenBSD: parse.y,v 1.25 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
#define MAXPUSHBACK 128
-u_char *parsebuf;
+char *parsebuf;
int parseindex;
-u_char pushback_buffer[MAXPUSHBACK];
+char pushback_buffer[MAXPUSHBACK];
int pushback_index = 0;
int
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
/* skip to either EOF or the first real EOL */
while (1) {
if (pushback_index)
- c = pushback_buffer[--pushback_index];
+ c = (unsigned char)pushback_buffer[--pushback_index];
else
c = lgetc(0);
if (c == '\n') {
int
yylex(void)
{
- u_char buf[8096];
- u_char *p;
+ char buf[8096];
+ char *p;
int quotec, next, c;
int token;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.77 2020/04/11 07:49:48 otto Exp $ */
+/* $OpenBSD: parse.y,v 1.78 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
#define MAXPUSHBACK 128
-u_char *parsebuf;
+char *parsebuf;
int parseindex;
-u_char pushback_buffer[MAXPUSHBACK];
+char pushback_buffer[MAXPUSHBACK];
int pushback_index = 0;
int
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
/* skip to either EOF or the first real EOL */
while (1) {
if (pushback_index)
- c = pushback_buffer[--pushback_index];
+ c = (unsigned char)pushback_buffer[--pushback_index];
else
c = lgetc(0);
if (c == '\n') {
int
yylex(void)
{
- u_char buf[8096];
- u_char *p;
+ char buf[8096];
+ char *p;
int quotec, next, c;
int token;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.50 2020/12/29 19:44:26 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.51 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.103 2021/01/25 06:16:38 dlg Exp $ */
+/* $OpenBSD: parse.y,v 1.104 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.18 2021/03/01 08:05:40 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.19 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
int
yylex(void)
{
- unsigned char buf[8096];
- unsigned char *p, *val;
- int quotec, next, c;
- int token;
+ char buf[8096];
+ char *p, *val;
+ int quotec, next, c;
+ int token;
top:
p = buf;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.12 2019/04/01 11:05:41 yasuoka Exp $ */
+/* $OpenBSD: parse.y,v 1.13 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
#define MAXPUSHBACK 128
-u_char *parsebuf;
+char *parsebuf;
int parseindex;
-u_char pushback_buffer[MAXPUSHBACK];
+char pushback_buffer[MAXPUSHBACK];
int pushback_index = 0;
int
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
/* skip to either EOF or the first real EOL */
while (1) {
if (pushback_index)
- c = pushback_buffer[--pushback_index];
+ c = (unsigned char)pushback_buffer[--pushback_index];
else
c = lgetc(0);
if (c == '\n') {
int
yylex(void)
{
- u_char buf[8096];
- u_char *p;
+ char buf[8096];
+ char *p;
int quotec, next, c;
int token;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.252 2021/01/17 15:17:13 rob Exp $ */
+/* $OpenBSD: parse.y,v 1.253 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.47 2019/05/10 01:29:31 guenther Exp $ */
+/* $OpenBSD: parse.y,v 1.48 2021/10/15 15:01:28 naddy Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
#define MAXPUSHBACK 128
-u_char *parsebuf;
+char *parsebuf;
int parseindex;
-u_char pushback_buffer[MAXPUSHBACK];
+char pushback_buffer[MAXPUSHBACK];
int pushback_index = 0;
int
if (parsebuf) {
/* Read character from the parsebuffer instead of input. */
if (parseindex >= 0) {
- c = parsebuf[parseindex++];
+ c = (unsigned char)parsebuf[parseindex++];
if (c != '\0')
return (c);
parsebuf = NULL;
}
if (pushback_index)
- return (pushback_buffer[--pushback_index]);
+ return ((unsigned char)pushback_buffer[--pushback_index]);
if (quotec) {
if ((c = getc(file->stream)) == EOF) {
if (parseindex >= 0)
return (c);
}
- if (pushback_index < MAXPUSHBACK-1)
- return (pushback_buffer[pushback_index++] = c);
- else
+ if (pushback_index + 1 >= MAXPUSHBACK)
return (EOF);
+ pushback_buffer[pushback_index++] = c;
+ return (c);
}
int
/* skip to either EOF or the first real EOL */
while (1) {
if (pushback_index)
- c = pushback_buffer[--pushback_index];
+ c = (unsigned char)pushback_buffer[--pushback_index];
else
c = lgetc(0);
if (c == '\n') {
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.289 2021/06/14 17:58:15 eric Exp $ */
+/* $OpenBSD: parse.y,v 1.290 2021/10/15 15:01:29 naddy Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
int
yylex(void)
{
- unsigned char buf[8096];
- unsigned char *p, *val;
- int quotec, next, c;
- int token;
+ char buf[8096];
+ char *p, *val;
+ int quotec, next, c;
+ int token;
top:
p = buf;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.69 2021/10/09 18:43:50 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.70 2021/10/15 15:01:29 naddy Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.15 2019/02/13 22:57:08 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.16 2021/10/15 15:01:29 naddy Exp $ */
/*
* Copyright (c) 2007-2016 Reyk Floeter <reyk@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.58 2021/06/16 16:55:02 dv Exp $ */
+/* $OpenBSD: parse.y,v 1.59 2021/10/15 15:01:29 naddy Exp $ */
/*
* Copyright (c) 2007-2016 Reyk Floeter <reyk@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}
-/* $OpenBSD: parse.y,v 1.33 2019/02/13 22:57:08 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.34 2021/10/15 15:01:29 naddy Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
int
yylex(void)
{
- u_char buf[8096];
- u_char *p, *val;
+ char buf[8096];
+ char *p, *val;
int quotec, next, c;
int token;
p = val + strlen(val) - 1;
lungetc(DONE_EXPAND);
while (p >= val) {
- lungetc(*p);
+ lungetc((unsigned char)*p);
p--;
}
lungetc(START_EXPAND);
} else {
nodigits:
while (p > buf + 1)
- lungetc(*--p);
- c = *--p;
+ lungetc((unsigned char)*--p);
+ c = (unsigned char)*--p;
if (c == '-')
return (c);
}