|
|
|
@ -15,7 +15,7 @@ static int parse_section(struct parser *p) { |
|
|
|
|
str_t *section = str_create(); |
|
|
|
|
uint32_t ch; |
|
|
|
|
while ((ch = parser_getch(p)) != UTF8_INVALID) { |
|
|
|
|
if (isdigit(ch)) { |
|
|
|
|
if (ch < 0x80 && isdigit(ch)) { |
|
|
|
|
assert(str_append_ch(section, ch) != -1); |
|
|
|
|
} else if (ch == ')') { |
|
|
|
|
if (!section->str) { |
|
|
|
@ -47,7 +47,7 @@ static void parse_preamble(struct parser *p) { |
|
|
|
|
struct tm *now_tm = localtime(&now); |
|
|
|
|
strftime(date, sizeof(date), "%F", now_tm); |
|
|
|
|
while ((ch = parser_getch(p)) != UTF8_INVALID) { |
|
|
|
|
if (isalnum(ch)) { |
|
|
|
|
if (ch < 0x80 && isalnum(ch)) { |
|
|
|
|
assert(str_append_ch(name, ch) != -1); |
|
|
|
|
} else if (ch == '(') { |
|
|
|
|
section = parse_section(p); |
|
|
|
|