src/config.c
changeset 62 2d6419d6d4ed
parent 58 500a5ea7fcb8
equal deleted inserted replaced
61:fb2cfcee38bd 62:2d6419d6d4ed
    62             value = strtok (NULL, "\n");
    62             value = strtok (NULL, "\n");
    63             map = 0;
    63             map = 0;
    64             while (CONFIG_OPTIONS[map] != NULL) {
    64             while (CONFIG_OPTIONS[map] != NULL) {
    65                 if (!strcmp (CONFIG_OPTIONS[map], token)) {
    65                 if (!strcmp (CONFIG_OPTIONS[map], token)) {
    66                     if (value) {
    66                     if (value) {
    67                         if (line[map] != '\0')
    67                         if (line[map] != NULL)
    68                             free (line[map]);
    68                             free (line[map]);
    69                         line[map] = compat_strdup (value);
    69                         line[map] = compat_strdup (value);
    70                     }
    70                     }
    71                 }
    71                 }
    72                 map++;
    72                 map++;
    74         }
    74         }
    75     }
    75     }
    76 
    76 
    77     map = 0;
    77     map = 0;
    78     while (CONFIG_OPTIONS[map] != NULL) {
    78     while (CONFIG_OPTIONS[map] != NULL) {
    79         if (line[map] != '\0')
    79         if (line[map] != NULL)
    80             switch (map) {
    80             switch (map) {
    81             case NICK:
    81             case NICK:
    82                 uc->nick = compat_strdup (line[map]);
    82                 uc->nick = compat_strdup (line[map]);
    83                 free (line[map]);
    83                 free (line[map]);
    84                 break;
    84                 break;