let quoted strings contain "\"" and "\n"

also let strings be "", ie. empty (is this a good change?)
This commit is contained in:
deraadt 1993-12-03 04:58:22 +00:00
parent 8d26954ec2
commit 45af4741ad
3 changed files with 7 additions and 5 deletions

View File

@ -114,7 +114,7 @@ needs-flag { yylval.val = FI_NEEDSFLAG; return FFLAG; }
{PATH} { yylval.str = intern(yytext); return PATHNAME; }
{WORD} { yylval.str = intern(yytext); return WORD; }
\"[^"]+/\" {
\"([^"]|\\\")*/\" {
yylval.str = intern(yytext + 1);
(void)input(); /* eat closing quote */
return WORD;

View File

@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)lang.l 5.8 (Berkeley) 4/19/91
* $Id: lang.l,v 1.4 1993/12/01 05:56:44 deraadt Exp $
* $Id: lang.l,v 1.5 1993/12/03 04:58:22 deraadt Exp $
*/
#include <ctype.h>
@ -124,9 +124,10 @@ WORD [A-Za-z_][-A-Za-z_]*
tprintf("(%s) ", yytext);
return i;
}
\"[^"]+\" {
\"([^\"]|\\\")*\" {
yytext[strlen(yytext)-1] = '\0';
yylval.str = yytext + 1;
tprintf("QID: %s", yylval.str);
return ID;
}
0[0-7]* {

View File

@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)lang.l 5.8 (Berkeley) 4/19/91
* $Id: lang.l,v 1.4 1993/12/01 05:56:44 deraadt Exp $
* $Id: lang.l,v 1.5 1993/12/03 04:58:22 deraadt Exp $
*/
#include <ctype.h>
@ -124,9 +124,10 @@ WORD [A-Za-z_][-A-Za-z_]*
tprintf("(%s) ", yytext);
return i;
}
\"[^"]+\" {
\"([^\"]|\\\")*\" {
yytext[strlen(yytext)-1] = '\0';
yylval.str = yytext + 1;
tprintf("QID: %s", yylval.str);
return ID;
}
0[0-7]* {