src/option_list.c
@@ -3,6 +3,24 @@ #include <string.h> #include "option_list.h" int read_option(char *s, list *options) { size_t i; size_t len = strlen(s); char *val = 0; for(i = 0; i < len; ++i){ if(s[i] == '='){ s[i] = '\0'; val = s+i+1; break; } } if(i == len-1) return 0; char *key = s; option_insert(options, key, val); return 1; } void option_insert(list *l, char *key, char *val) { kvp *p = malloc(sizeof(kvp));