[Goodies-commits] r5758 - xfbib/branches/gobject/src

David Gustafsson tssj at xfce.org
Wed Oct 22 23:22:01 CEST 2008


Author: tssj
Date: 2008-10-22 21:22:01 +0000 (Wed, 22 Oct 2008)
New Revision: 5758

Modified:
   xfbib/branches/gobject/src/xfbib-bibtex-entry.c
Log:
Refixed the bug in the parser but in a smarter way


Modified: xfbib/branches/gobject/src/xfbib-bibtex-entry.c
===================================================================
--- xfbib/branches/gobject/src/xfbib-bibtex-entry.c	2008-10-22 20:54:32 UTC (rev 5757)
+++ xfbib/branches/gobject/src/xfbib-bibtex-entry.c	2008-10-22 21:22:01 UTC (rev 5758)
@@ -119,7 +119,8 @@
 	buf = g_string_erase(buf, 0, -1);
 
 	for (i++, brackets = 0, quotes = 0; i < len; i++) {
-		if (tmp[i] == ',' && brackets == 0 && quotes%2 == 0) {
+		if (tmp[i] == ',' && ((entry->separator == '{' && brackets == 0) ||
+					(entry->separator == '"' && quotes%2 == 0))) {
 			field = xfbib_bibtex_field_new();
 			if (!xfbib_bibtex_field_parse(field, buf->str))
 				return FALSE;
@@ -130,7 +131,7 @@
 			brackets++;
 		} else if (tmp[i] == '}' || tmp[i] == ')') {
 			brackets--;
-		} else if (tmp[i] == '"' && tmp[i-1] != '\\') {
+		} else if (tmp[i] == '"') {
 			quotes++;
 		}
 		buf = g_string_append_c(buf, tmp[i]);




More information about the Goodies-commits mailing list