Thu Dec 14 07:58:06 PST 2006
- Previous message: [Slony1-commit] By cbbrowne: xxid makefile update - "make clean" should no longer purge
- Next message: [Slony1-commit] By cbbrowne: Fix to slon conf file parser (conf-file.l) per Jeff Davis.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message:
-----------
Fix to slon conf file parser (conf-file.l) per Jeff Davis.
There were two problems that could occur on the last line:
1. The parser couldn't cope with the final line having a comment and no
\n --> Syntax error
2. If the final line set a parameter, but didn't have a \n, that
request would get lost
Both issues are fixed with this.
Tags:
----
REL_1_2_STABLE
Modified Files:
--------------
slony1-engine/src/slon:
conf-file.l (r1.5.2.3 -> r1.5.2.4)
-------------- next part --------------
Index: conf-file.l
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/conf-file.l,v
retrieving revision 1.5.2.3
retrieving revision 1.5.2.4
diff -Lsrc/slon/conf-file.l -Lsrc/slon/conf-file.l -u -w -r1.5.2.3 -r1.5.2.4
--- src/slon/conf-file.l
+++ src/slon/conf-file.l
@@ -68,7 +68,7 @@
\n ConfigFileLineno++; return SLON_EOL;
[ \t\r]+ /* eat whitespace */
-#.*$ /* eat comment */
+#.* /* eat comment */
{ID} return SLON_ID;
{QUALIFIED_ID} return SLON_QUALIFIED_ID;
@@ -151,7 +151,6 @@
tail = head;
opt_name = NULL;
opt_value = opt_name;
-
while ( (token = yylex()) )
{
switch(parse_state)
@@ -223,6 +222,42 @@
break;
}
}
+ /*
+ * If we encountered an EOF after we've already
+ * reached parse_state of 2, we already have a complete
+ * configuration line, it's just terminated with EOF
+ * instead of EOL. Store that config option.
+ */
+ if (parse_state == 2)
+ {
+ item = malloc(sizeof *item);
+ item->name = opt_name;
+ item->value = opt_value;
+ if (strcmp(opt_name, "custom_variable_classes") == 0)
+ {
+ item->next = head;
+ head = item;
+ if (!tail)
+ {
+ tail = item;
+ }
+ }
+ else
+ {
+ /* append to list */
+ item->next = NULL;
+ if (!head)
+ {
+ head = item;
+ }
+ else
+ {
+ tail->next = item;
+ }
+ tail = item;
+ }
+ parse_state = 0;
+ }
fclose(fp);
- Previous message: [Slony1-commit] By cbbrowne: xxid makefile update - "make clean" should no longer purge
- Next message: [Slony1-commit] By cbbrowne: Fix to slon conf file parser (conf-file.l) per Jeff Davis.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list