This allows weird commands like /bin/echo to be used for real. No command
arguments handling yet, though, as well as quoting.
okay tedu@
-/* $OpenBSD: parse.y,v 1.1 2015/07/16 20:44:21 tedu Exp $ */
+/* $OpenBSD: parse.y,v 1.2 2015/07/16 22:11:01 nicm Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
return c;
case EOF:
return 0;
- case ':':
- *p++ = c;
- c = getc(yyfp);
- break;
- default:
- break;
}
- while (isalnum(c)) {
+ while (1) {
+ switch (c) {
+ case '\n':
+ case '{':
+ case '}':
+ case '#':
+ case ' ':
+ case '\t':
+ case EOF:
+ goto eow;
+ }
*p++ = c;
if (p == ebuf)
yyerror("too much stuff");
c = getc(yyfp);
}
+eow:
*p = 0;
if (c != EOF)
ungetc(c, yyfp);