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;
|
*dst_iter++ = *src_iter;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
if (*src_iter == '\\')
|
|
||||||
*dst_iter++ = '\\';
|
|
||||||
|
|
||||||
*dst_iter++ = *src_iter;
|
*dst_iter++ = *src_iter;
|
||||||
}
|
|
||||||
|
|
||||||
escaped = false;
|
escaped = false;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +96,7 @@ pkgconf_argv_split(const char *src, int *argc, char ***argv)
|
||||||
{
|
{
|
||||||
if (*src_iter == quote)
|
if (*src_iter == quote)
|
||||||
quote = 0;
|
quote = 0;
|
||||||
else if (*src_iter == '\\')
|
else if (*src_iter == '\\' && quote != '\'')
|
||||||
escaped = true;
|
escaped = true;
|
||||||
else
|
else
|
||||||
*dst_iter++ = *src_iter;
|
*dst_iter++ = *src_iter;
|
||||||
|
|
|
@ -405,7 +405,7 @@ fragment_should_quote(const pkgconf_fragment_t *frag)
|
||||||
(*src > 'Z' && *src < '^') ||
|
(*src > 'Z' && *src < '^') ||
|
||||||
(*src == '`') ||
|
(*src == '`') ||
|
||||||
(*src > 'z' && *src < '~') ||
|
(*src > 'z' && *src < '~') ||
|
||||||
(*src > '~')) && *src != '\\')
|
(*src > '~')))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ escaped_backslash_body()
|
||||||
{
|
{
|
||||||
atf_check \
|
atf_check \
|
||||||
-e ignore \
|
-e ignore \
|
||||||
-o inline:"-IC:\\\\\\\\A \n" \
|
-o inline:"'-IC:\\A' \n" \
|
||||||
pkgconf --with-path=${selfdir}/lib1 --cflags escaped-backslash
|
pkgconf --with-path=${selfdir}/lib1 --cflags escaped-backslash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue