forked from ariadne/pkgconf
libpkgconf: argvsplit: fix escape handling in tokenizer (closes #163)
parent
6073a49229
commit
cf96c562e1
|
@ -88,12 +88,7 @@ pkgconf_argv_split(const char *src, int *argc, char ***argv)
|
|||
*dst_iter++ = *src_iter;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*src_iter == '\\')
|
||||
*dst_iter++ = '\\';
|
||||
|
||||
*dst_iter++ = *src_iter;
|
||||
}
|
||||
|
||||
escaped = false;
|
||||
}
|
||||
|
@ -101,7 +96,7 @@ pkgconf_argv_split(const char *src, int *argc, char ***argv)
|
|||
{
|
||||
if (*src_iter == quote)
|
||||
quote = 0;
|
||||
else if (*src_iter == '\\')
|
||||
else if (*src_iter == '\\' && quote != '\'')
|
||||
escaped = true;
|
||||
else
|
||||
*dst_iter++ = *src_iter;
|
||||
|
|
|
@ -405,7 +405,7 @@ fragment_should_quote(const pkgconf_fragment_t *frag)
|
|||
(*src > 'Z' && *src < '^') ||
|
||||
(*src == '`') ||
|
||||
(*src > 'z' && *src < '~') ||
|
||||
(*src > '~')) && *src != '\\')
|
||||
(*src > '~')))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ escaped_backslash_body()
|
|||
{
|
||||
atf_check \
|
||||
-e ignore \
|
||||
-o inline:"-IC:\\\\\\\\A \n" \
|
||||
-o inline:"'-IC:\\A' \n" \
|
||||
pkgconf --with-path=${selfdir}/lib1 --cflags escaped-backslash
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue