comparison src/gaimrc.c @ 4410:61c9c2bd2a9c

[gaim-migrate @ 4683] gaimrc_read_users buf fix committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Sat, 25 Jan 2003 21:09:54 +0000
parents cb629f3efee6
children bf770f11132b
comparison
equal deleted inserted replaced
4409:0521eec12c33 4410:61c9c2bd2a9c
623 } 623 }
624 624
625 static void gaimrc_read_users(FILE *f) 625 static void gaimrc_read_users(FILE *f)
626 { 626 {
627 char buf[2048]; 627 char buf[2048];
628 struct aim_user *u; 628 struct aim_user *u=NULL;
629 struct parse parse_buffer; 629 struct parse parse_buffer;
630 struct parse *p; 630 struct parse *p=NULL;
631 631
632 buf[0] = 0; 632 buf[0] = 0;
633 633
634 while (buf[0] != '}') { 634 while (fgets(buf, sizeof(buf), f)) {
635 if (buf[0] == '#') 635 if (buf[0] == '#')
636 continue; 636 continue;
637 637 else if(buf[0] == '}')
638 if (!fgets(buf, sizeof(buf), f)) 638 break;
639 return;
640
641
642 639
643 p = parse_line(buf, &parse_buffer); 640 p = parse_line(buf, &parse_buffer);
644 641
645 if (!strcmp(p->option, "current_user")) { 642 if (strcmp(p->option, "user")==0 ||
646 } else if (strcmp(p->option, "user")) { 643 strcmp(p->option, "current_user")==0) {
647 continue; 644 if((u=gaimrc_read_user(f))!=NULL)
648 } else { 645 aim_users = g_slist_append(aim_users, u);
649 } 646 else {
650 647 debug_printf("Error reading in users from .gaimrc\n");
651 u = gaimrc_read_user(f); 648 return;
652 649 }
653 aim_users = g_slist_append(aim_users, u); 650 }
654 } 651 }
655 } 652 }
656 653
657 static void gaimrc_write_users(FILE *f) 654 static void gaimrc_write_users(FILE *f)
658 { 655 {