comparison src/gaimrc.c @ 5514:5664dbaf670c

[gaim-migrate @ 5913] This fixes a bug where the global proxy hostname would often not get read from the .gaimrc file correctly. It is described in http://sourceforge.net/tracker/index.php?func=detail&aid=743110&group_id=235&atid=100235 http://sourceforge.net/tracker/index.php?func=detail&aid=742985&group_id=235&atid=100235 The problem was that there was an extra new line at the end of the file, so gaimrc_parse_tag was unable to read in a new prefs section, and it would end up deciding that you were trying to read in the "proxy" section again because it used the same memory it used the previous time it was called, which meant that the buffer contained "proxy." I think I caused this with the following commit: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gaim/gaim/src/gaimrc.c.diff?r1=1.160&r2=1.162 committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 25 May 2003 17:06:30 +0000
parents 702071b23c06
children 0aa4d089125c
comparison
equal deleted inserted replaced
5513:d1524728d491 5514:5664dbaf670c
200 fgets(buf, sizeof(buf), f); 200 fgets(buf, sizeof(buf), f);
201 201
202 if (feof(f)) 202 if (feof(f))
203 return -1; 203 return -1;
204 204
205 sscanf(buf, "%s {", tag); 205 if (sscanf(buf, "%s {", tag) != 1)
206 return -1;
206 207
207 if (!strcmp(tag, "users")) { 208 if (!strcmp(tag, "users")) {
208 return 0; 209 return 0;
209 } else if (!strcmp(tag, "options")) { 210 } else if (!strcmp(tag, "options")) {
210 return 1; 211 return 1;
1505 int tag = gaimrc_parse_tag(f); 1506 int tag = gaimrc_parse_tag(f);
1506 gaim_debug(GAIM_DEBUG_MISC, "gaimrc", 1507 gaim_debug(GAIM_DEBUG_MISC, "gaimrc",
1507 "starting read tag %d\n", tag); 1508 "starting read tag %d\n", tag);
1508 switch (tag) { 1509 switch (tag) {
1509 case -1: 1510 case -1:
1510 /* Let the loop end, EOF */ 1511 /* Do nothing--either EOF or empty line */
1511 break; 1512 break;
1512 case 0: 1513 case 0:
1513 gaimrc_read_users(f); 1514 gaimrc_read_users(f);
1514 break; 1515 break;
1515 case 1: 1516 case 1: