argvsplit: fix some quoting rules

master
huyubiao 2023-03-06 20:05:22 +08:00 committed by Ariadne Conill
parent 212c85863a
commit 6d1f160e89
3 changed files with 2 additions and 7 deletions

View File

@ -89,11 +89,6 @@ pkgconf_argv_split(const char *src, int *argc, char ***argv)
}
else
{
/* If we are outside a quoted string/char, an escaped space is usually used to
preserve spaces in file names. */
if (!(*src_iter == '$' || *src_iter == '`' || *src_iter == '"' || *src_iter == '\\' || *src_iter == ' '))
*dst_iter++ = '\\';
*dst_iter++ = *src_iter;
}

View File

@ -7,4 +7,4 @@ Name: quotes
Description: A testing pkg-config file
Version: 1.2.3
Libs: -L${libdir} -lfoo
Cflags: -DQUOTED=\"bla\"
Cflags: -DQUOTED=\"bla\" -DA=\"escaped\ string\'\ \literal\" -DB="\1\$" -DC='bla'

View File

@ -142,7 +142,7 @@ quoted_body()
{
export PKG_CONFIG_PATH="${selfdir}/lib1"
atf_check \
-o inline:"-DQUOTED=\\\"bla\\\"\n" \
-o inline:"-DQUOTED=\\\"bla\\\" -DA=\\\"escaped\\ string\\\'\\ literal\\\" -DB=\\\\\\1\$ -DC=bla\n" \
pkgconf --cflags quotes
}