libpkgconf: hopefully the last necessary tweak to quoting...

feature/tap-sh
William Pitcock 2017-03-29 18:00:57 -05:00
parent 77ca17b6ff
commit 6e643aa432
2 changed files with 6 additions and 4 deletions

View File

@ -88,8 +88,10 @@ pkgconf_argv_split(const char *src, int *argc, char ***argv)
} }
else else
{ {
if (!isspace((unsigned int) *src_iter)) if (isspace((unsigned int) *src_iter))
*dst_iter++ = *src_iter; *dst_iter++ = '\\';
*dst_iter++ = *src_iter;
} }
escaped = false; escaped = false;

View File

@ -387,7 +387,7 @@ fragment_escape(const char *src)
while (*src) while (*src)
{ {
if ((*src < ' ') || if (((*src < ' ') ||
(*src > ' ' && *src < '$') || (*src > ' ' && *src < '$') ||
(*src > '$' && *src < '(') || (*src > '$' && *src < '(') ||
(*src > ')' && *src < '+') || (*src > ')' && *src < '+') ||
@ -396,7 +396,7 @@ fragment_escape(const char *src)
(*src > 'Z' && *src < '^') || (*src > 'Z' && *src < '^') ||
(*src == '`') || (*src == '`') ||
(*src > 'z' && *src < '~') || (*src > 'z' && *src < '~') ||
(*src > '~')) (*src > '~')) && *src != '\\')
*dst++ = '\\'; *dst++ = '\\';
*dst++ = *src++; *dst++ = *src++;