A value as written: quotes of a quoted string removed. */
| 150 | |
| 151 | /* A value as written: quotes of a quoted string removed. */ |
| 152 | static const char *dk_value(const dk_t *d, TSNode n) { |
| 153 | const char *s = dk_text(d, n); |
| 154 | size_t l = s ? strlen(s) : 0; |
| 155 | if (l >= PAIR_LEN && (s[0] == '"' || s[0] == '\'') && s[l - SKIP_ONE] == s[0]) { |
| 156 | char *v = cbm_arena_alloc(d->a, l - SKIP_ONE); |
| 157 | if (v) { |
| 158 | memcpy(v, s + SKIP_ONE, l - PAIR_LEN); |
| 159 | v[l - PAIR_LEN] = '\0'; |
| 160 | } |
| 161 | return v; |
| 162 | } |
| 163 | return s; |
| 164 | } |
| 165 | |
| 166 | static const dk_var_t *dk_find(const dk_var_t *v, const char *name, size_t nl) { |
| 167 | for (; v; v = v->next) { |
no test coverage detected