changeset 4049:198a5edcb1c5

[gaim-migrate @ 4258] A patch from Eric Timme. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 05 Dec 2002 20:38:07 +0000
parents 3f4043d4e59b
children 9438d2e96cb1
files src/gaimrc.c
diffstat 1 files changed, 21 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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;