[gaim-migrate @ 4258]

Thu, 05 Dec 2002 20:38:07 +0000

author
Eric Timme
date
Thu, 05 Dec 2002 20:38:07 +0000
changeset 4049
29cf029df01f
parent 4048
0b40080fff25
child 4050
94e1fbe758f3

[gaim-migrate @ 4258]
A patch from Eric Timme.

committer: Sean Egan <seanegan@pidgin.im>

src/gaimrc.c file | annotate | diff | comparison | revisions
--- a/src/gaimrc.c	Thu Dec 05 02:35:57 2002 +0000
+++ b/src/gaimrc.c	Thu Dec 05 20:38:07 2002 +0000
@@ -84,14 +84,13 @@
 		p->value[x][0] = 0;
 	}
 
-
 	while (*c) {
 		if (*c == '\t') {
 			c++;
 			continue;
 		}
+		
 		if (inopt) {
-			/*   if ((*c < 'a' || *c > 'z') && *c != '_') { */
 			if ((*c < 'a' || *c > 'z') && *c != '_' && (*c < 'A' || *c > 'Z')) {
 				inopt = 0;
 				p->option[optlen] = 0;
@@ -104,29 +103,38 @@
 			c++;
 			continue;
 		} else if (inval) {
-			if ((*c == '}')) {
-				if (*(c - 1) == '\\') {
-					p->value[curval][vallen - 1] = *c;
-					c++;
-					continue;
-				} else {
-					p->value[curval][vallen - 1] = 0;
-					inval = 0;
-					c++;
-					continue;
-				}
+			if (*c == '\\') {
+				/* if we have a \ take the char after it literally.. */
+				c++;
+				p->value[curval][vallen] = *c;
+
+				vallen++;
+				c++;
+				continue;
+			} else if (*c == '}') {
+				/* } that isn't escaped should end this chunk of data, and
+				 * should have a space before it.. */
+				p->value[curval][vallen - 1] = 0;
+				inval = 0;
+				c++;
+				continue;
 			} else {
 				p->value[curval][vallen] = *c;
+
 				vallen++;
 				c++;
 				continue;
 			}
 		} else if (*c == '{') {
+			/* i really don't think this if ever succeeds, but i'm
+			 * not brave enough to take it out... */ 
 			if (*(c - 1) == '\\') {
 				p->value[curval][vallen - 1] = *c;
 				c++;
 				continue;
 			} else {
+				/* { that isn't escaped should signify the start of a
+				 * piece of data and should have a space after it.. */
 				curval++;
 				vallen = 0;
 				inval = 1;

mercurial