| 86 | } |
| 87 | |
| 88 | static char *getString(const char *str) { |
| 89 | if (str[0] != '"') |
| 90 | return NULL; |
| 91 | |
| 92 | char *p = strchr(str + 1, '"'); |
| 93 | if (!p) |
| 94 | return NULL; |
| 95 | |
| 96 | int len = p - (str + 1); |
| 97 | |
| 98 | char *out = malloc(len + 1); |
| 99 | strncpy(out, str + 1, len); |
| 100 | out[len] = '\0'; |
| 101 | |
| 102 | int i; |
| 103 | for (i = 0; i < len; i++) { |
| 104 | if (out[i] == '\\') |
| 105 | out[i] = '\n'; |
| 106 | } |
| 107 | |
| 108 | return out; |
| 109 | } |
| 110 | |
| 111 | static int readEntry(const char *line, ConfigEntry *entries, int n_entries) { |
| 112 | // Trim at beginning |