Mercurial > pidgin
comparison src/toc.c @ 793:57cc66fbfa8e
[gaim-migrate @ 803]
hm hm hm. we probably shouldn't free memory we're going to be using later.
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Tue, 29 Aug 2000 22:46:24 +0000 |
| parents | b61607d6c2af |
| children | 55194c5f338f |
comparison
equal
deleted
inserted
replaced
| 792:24f1f5dc7c15 | 793:57cc66fbfa8e |
|---|---|
| 862 char current[256]; | 862 char current[256]; |
| 863 char *name; | 863 char *name; |
| 864 GList *bud; | 864 GList *bud; |
| 865 int how_many = 0; | 865 int how_many = 0; |
| 866 | 866 |
| 867 /* Clean out the permit/deny list!*/ | |
| 868 /* why? if we're going to merge things, then these should stay | |
| 869 g_list_free(permit); | |
| 870 g_list_free(deny); | |
| 871 permit = NULL; | |
| 872 deny = NULL; | |
| 873 */ | |
| 874 bud = NULL; | 867 bud = NULL; |
| 875 | 868 |
| 876 /* skip "CONFIG:" (if it exists)*/ | 869 /* skip "CONFIG:" (if it exists)*/ |
| 877 | 870 |
| 878 if (config != NULL) { | 871 if (config != NULL) { |
| 903 | 896 |
| 904 bud = g_list_append(bud, c+2); | 897 bud = g_list_append(bud, c+2); |
| 905 } else if (*c == 'p') { | 898 } else if (*c == 'p') { |
| 906 GList *d = permit; | 899 GList *d = permit; |
| 907 char *n; | 900 char *n; |
| 908 name = g_malloc(strlen(c+2) + 2); | |
| 909 g_snprintf(name, strlen(c+2) + 1, "%s", c+2); | 901 g_snprintf(name, strlen(c+2) + 1, "%s", c+2); |
| 910 n = g_strdup(normalize(name)); | 902 n = g_strdup(normalize(name)); |
| 911 while (d) { | 903 while (d) { |
| 912 if (!strcasecmp(n, normalize(d->data))) | 904 if (!strcasecmp(n, normalize(d->data))) |
| 913 break; | 905 break; |
| 914 d = d->next; | 906 d = d->next; |
| 915 } | 907 } |
| 916 g_free(n); | 908 g_free(n); |
| 917 if (!d) | 909 if (!d) |
| 918 permit = g_list_append(permit, name); | 910 permit = g_list_append(permit, name); |
| 919 g_free(name); | |
| 920 } else if (*c == 'd') { | 911 } else if (*c == 'd') { |
| 921 GList *d = deny; | 912 GList *d = deny; |
| 922 char *n; | 913 char *n; |
| 923 name = g_malloc(strlen(c+2) + 2); | 914 name = g_malloc(strlen(c+2) + 2); |
| 924 g_snprintf(name, strlen(c+2) + 1, "%s", c+2); | 915 g_snprintf(name, strlen(c+2) + 1, "%s", c+2); |
| 929 d = d->next; | 920 d = d->next; |
| 930 } | 921 } |
| 931 g_free(n); | 922 g_free(n); |
| 932 if (!d) | 923 if (!d) |
| 933 deny = g_list_append(deny, name); | 924 deny = g_list_append(deny, name); |
| 934 g_free(name); | 925 } else if (!strncmp("toc", c, 3)) { |
| 935 } else if (*c == 't') { | 926 sscanf(c + strlen(c) - 1, "%d", &permdeny); |
| 936 sscanf(c + strlen(c) - 2, "%d", &permdeny); | 927 sprintf(debug_buff, "permdeny: %d\n", permdeny); |
| 928 debug_print(debug_buff); | |
| 929 if (permdeny == 0) | |
| 930 permdeny = 1; | |
| 931 } else if (*c == 'm') { | |
| 932 sscanf(c + 2, "%d", &permdeny); | |
| 933 sprintf(debug_buff, "permdeny: %d\n", permdeny); | |
| 934 debug_print(debug_buff); | |
| 937 if (permdeny == 0) | 935 if (permdeny == 0) |
| 938 permdeny = 1; | 936 permdeny = 1; |
| 939 } | 937 } |
| 940 } while((c=strtok(NULL,"\n"))); | 938 } while((c=strtok(NULL,"\n"))); |
| 941 #if 0 | 939 #if 0 |
