Strip inline comments from a value string (not inside quotes). * Returns the adjusted length. */
| 160 | /* Strip inline comments from a value string (not inside quotes). |
| 161 | * Returns the adjusted length. */ |
| 162 | static int strip_inline_comment(const char *after, int after_len) { |
| 163 | if (after_len > 0 && after[0] != '"' && after[0] != '\'') { |
| 164 | for (int i = 0; i < after_len; i++) { |
| 165 | if (after[i] == '#' && i > 0 && after[i - SKIP_ONE] == ' ') { |
| 166 | after_len = i; |
| 167 | while (after_len > 0 && isspace((unsigned char)after[after_len - SKIP_ONE])) { |
| 168 | after_len--; |
| 169 | } |
| 170 | break; |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | return after_len; |
| 175 | } |
| 176 | |
| 177 | /* Peek ahead to check if next content line is a list item. */ |
| 178 | static bool peek_is_list(const char *eol, const char *end) { |