]> git.pld-linux.org Git - packages/autofs.git/blame - autofs-5.0.4-reset-flex-scanner-when-setting-buffer.patch
- import latest patchset.
[packages/autofs.git] / autofs-5.0.4-reset-flex-scanner-when-setting-buffer.patch
CommitLineData
e5fd101c
PS
1autofs-5.0.4 - reset flex scanner when setting buffer
2
3From: Ian Kent <raven@themaw.net>
4
5We still have problems resetting the flex scan buffer after an error
6is detected. This appears to fix the problem.
7---
8
9 CHANGELOG | 1 +
10 lib/master_tok.l | 9 ++++++++-
11 2 files changed, 9 insertions(+), 1 deletions(-)
12
13
14diff --git a/CHANGELOG b/CHANGELOG
15index c8b88e4..5f1cf7f 100644
16--- a/CHANGELOG
17+++ b/CHANGELOG
18@@ -38,6 +38,7 @@
19 - fix lsb init script header.
20 - fix memory leak reading master map.
21 - fix st_remove_tasks() locking.
22+- reset flex scanner when setting buffer.
23
24 4/11/2008 autofs-5.0.4
25 -----------------------
26diff --git a/lib/master_tok.l b/lib/master_tok.l
27index b6cc8be..373248b 100644
28--- a/lib/master_tok.l
29+++ b/lib/master_tok.l
30@@ -130,7 +130,6 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo
31 \x00 {
32 if (optr != buff) {
33 *optr = '\0';
34- optr = buff;
35 strcpy(master_lval.strtype, buff);
36 return NILL;
37 }
38@@ -139,6 +138,11 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo
39 #.* { return COMMENT; }
40
41 "/" {
42+ if (optr != buff) {
43+ *optr = '\0';
44+ strcpy(master_lval.strtype, buff);
45+ return NILL;
46+ }
47 BEGIN(PATHSTR);
48 bptr = buff;
49 yyless(0);
50@@ -410,6 +414,9 @@ static void master_echo(void)
51
52 void master_set_scan_buffer(const char *buffer)
53 {
54+ master_lex_destroy();
55+ optr = buff;
56+
57 line = buffer;
58 line_pos = &line[0];
59 /*
This page took 0.067537 seconds and 4 git commands to generate.