argvsplit: fix some quoting rules to match POSIX
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
parent
6a5b55740d
commit
be0d811942
|
@ -80,7 +80,7 @@ pkgconf_argv_split(const char *src, int *argc, char ***argv)
|
|||
if (escaped)
|
||||
{
|
||||
/* POSIX: only \CHAR is special inside a double quote if CHAR is {$, `, ", \, newline}. */
|
||||
if (quote)
|
||||
if (quote == '"')
|
||||
{
|
||||
if (!(*src_iter == '$' || *src_iter == '`' || *src_iter == '"' || *src_iter == '\\'))
|
||||
*dst_iter++ = '\\';
|
||||
|
@ -91,7 +91,7 @@ pkgconf_argv_split(const char *src, int *argc, char ***argv)
|
|||
{
|
||||
/* If we are outside a quoted string/char, an escaped space is usually used to
|
||||
preserve spaces in file names. */
|
||||
if (*src_iter != ' ')
|
||||
if (!(*src_iter == '$' || *src_iter == '`' || *src_iter == '"' || *src_iter == '\\' || *src_iter == ' '))
|
||||
*dst_iter++ = '\\';
|
||||
|
||||
*dst_iter++ = *src_iter;
|
||||
|
|
Loading…
Reference in New Issue