builder: ignore spaces after repo identifiers (RHBZ#1506511)

This commit is contained in:
Pino Toscano
2017-10-26 16:09:45 +02:00
parent 0942241395
commit 0d4136c69f
4 changed files with 8 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ EXTRA_DIST = \
test-virt-index-validate-good-1 \
test-virt-index-validate-good-2 \
test-virt-index-validate-good-3 \
test-virt-index-validate-good-4 \
virt-builder.pod \
virt-index-validate.pod \
yajl_tests.ml

View File

@@ -78,8 +78,9 @@ extern void scanner_destroy (yyscan_t scanner);
^\n { return EMPTY_LINE; }
/* [...] marks beginning of a section. */
^"["[-A-Za-z0-9._]+"]"\n {
yylval->str = strndup (yytext+1, yyleng-3);
^"["[-A-Za-z0-9._]+"]"[[:blank:]]*\n {
const char *end = strrchr (yytext, ']');
yylval->str = strndup (yytext+1, end-yytext-1);
return SECTION_HEADER;
}

View File

@@ -0,0 +1,3 @@
# Empty spaces after the repository identifier
[foo]
key=value

View File

@@ -23,3 +23,4 @@ set -e
$VG virt-index-validate test-virt-index-validate-good-1
$VG virt-index-validate test-virt-index-validate-good-2
$VG virt-index-validate test-virt-index-validate-good-3
$VG virt-index-validate test-virt-index-validate-good-4