src/arguments.c

changeset 109
4de447ff165b
parent 103
31fa205db85a
equal deleted inserted replaced
108:47be4044845b 109:4de447ff165b
47 return ret; 47 return ret;
48 } 48 }
49 49
50 void parse_csl(const char *csl, string_list *list) { 50 void parse_csl(const char *csl, string_list *list) {
51 if (csl != NULL) { 51 if (csl != NULL) {
52 list->free_item = free;
52 char *buf = strdup(csl); 53 char *buf = strdup(csl);
53 char *finder = strtok(buf, ","); 54 char *finder = strtok(buf, ",");
54 while (finder != NULL) { 55 while (finder != NULL) {
55 add_string(list, finder); 56 add_string(list, strdup(finder));
56 finder = strtok(NULL, ","); 57 finder = strtok(NULL, ",");
57 } 58 }
58 free(buf); 59 free(buf);
59 } 60 }
60 } 61 }

mercurial