- another try a fixing lexer matching map type in map name.

This commit is contained in:
Ian Kent 2008-03-30 03:58:30 +00:00
parent 4244e9bb1d
commit 510e885d21
2 changed files with 29 additions and 41 deletions

View File

@ -11,65 +11,50 @@ index af5a1b0..76f2477 100644
14/01/2008 autofs-5.0.3 14/01/2008 autofs-5.0.3
----------------------- -----------------------
diff --git a/lib/master_tok.l b/lib/master_tok.l diff --git a/lib/master_tok.l b/lib/master_tok.l
index b379940..eab6bb1 100644 index b379940..4bbe033 100644
--- a/lib/master_tok.l --- a/lib/master_tok.l
+++ b/lib/master_tok.l +++ b/lib/master_tok.l
@@ -77,6 +77,7 @@ int my_yyinput(char *, int); @@ -77,6 +77,7 @@ int my_yyinput(char *, int);
char buff[1024]; char buff[1024];
char *bptr; char *bptr;
char *optr = buff; char *optr = buff;
+char *tptr; +unsigned int tlen;
%} %}
@@ -161,6 +162,15 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo @@ -190,13 +191,27 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo
return QUOTE;
}
+ {WS}/({MULTI}|{MTYPE}) {
+ BEGIN(MAPSTR);
+ *bptr = '\0';
+ strcpy(master_lval.strtype, buff);
+ bptr = buff;
+ yyless(0);
+ return(PATH);
+ }
+
{WS} {
BEGIN(MAPSTR);
*bptr = '\0';
@@ -189,17 +199,25 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo
<MAPSTR>{
{OPTWS}\\\n{OPTWS} {} {OPTWS}\\\n{OPTWS} {}
- {MULTI} { {MULTI} {
- strcpy(master_lval.strtype, master_text); - strcpy(master_lval.strtype, master_text);
+ {WS}{MULTI} { - return(MULTITYPE);
+ tptr = master_text; + tlen = master_leng - 1;
+ while (*tptr && isblank(*tptr)) { + if (bptr != buff && isblank(master_text[tlen])) {
+ tptr++; + strncat(buff, master_text, tlen);
+ bptr += tlen;
+ yyless(tlen);
+ } else {
+ strcpy(master_lval.strtype, master_text);
+ return(MULTITYPE);
+ } + }
+ strcpy(master_lval.strtype, tptr);
return(MULTITYPE);
} }
- {MTYPE} { {MTYPE} {
- strcpy(master_lval.strtype, master_text); - strcpy(master_lval.strtype, master_text);
+ {WS}{MTYPE} { - return(MAPTYPE);
+ tptr = master_text; + tlen = master_leng - 1;
+ while (*tptr && isblank(*tptr)) { + if (bptr != buff && isblank(master_text[tlen])) {
+ tptr++; + strncat(buff, master_text, tlen);
+ bptr += tlen;
+ yyless(tlen);
+ } else {
+ strcpy(master_lval.strtype, master_text);
+ return(MAPTYPE);
+ } + }
+ strcpy(master_lval.strtype, tptr);
return(MAPTYPE);
} }
- {MULTISEP} { return(DDASH); } {MULTISEP} { return(DDASH); }
+ {WS}{MULTISEP} { return(DDASH); } @@ -226,7 +241,7 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo
":" { return(COLON); }
@@ -226,7 +244,7 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo
yyless(0); yyless(0);
} }

View File

@ -4,7 +4,7 @@
Summary: A tool for automatically mounting and unmounting filesystems Summary: A tool for automatically mounting and unmounting filesystems
Name: autofs Name: autofs
Version: 5.0.3 Version: 5.0.3
Release: 9 Release: 10
Epoch: 1 Epoch: 1
License: GPL License: GPL
Group: System Environment/Daemons Group: System Environment/Daemons
@ -125,6 +125,9 @@ fi
%{_libdir}/autofs/ %{_libdir}/autofs/
%changelog %changelog
* Sun Mar 30 2008 Ian Kent <ikent@redhat.com> - 5.0.3-10
- another try a fixing lexer matching map type in map name.
* Wed Mar 26 2008 Ian Kent <ikent@redhat.com> - 5.0.3-9 * Wed Mar 26 2008 Ian Kent <ikent@redhat.com> - 5.0.3-9
- fix lexer ambiguity in match when map type name is included in map name. - fix lexer ambiguity in match when map type name is included in map name.