From: Tom Lane Date: Tue, 6 Sep 2016 18:53:31 +0000 (-0400) Subject: Teach appendShellString() to not quote strings containing "-". X-Git-Tag: REL_10_BETA1~1765 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cdc70597c9ba62aad08a46e55c0c783bf4c21c9c;p=thirdparty%2Fpostgresql.git Teach appendShellString() to not quote strings containing "-". Brain fade in commit a00c58314: I was thinking that a string starting with "-" could be taken as a switch depending on command line syntax. That's true, but having appendShellString() quote it will not help, so we may as well not do so. Per complaint from Peter Eisentraut. --- diff --git a/src/fe_utils/string_utils.c b/src/fe_utils/string_utils.c index edbc869e453..61bf9e6ca60 100644 --- a/src/fe_utils/string_utils.c +++ b/src/fe_utils/string_utils.c @@ -439,7 +439,7 @@ appendShellString(PQExpBuffer buf, const char *str) * contains only safe characters. */ if (*str != '\0' && - strspn(str, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_./:") == strlen(str)) + strspn(str, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_./:") == strlen(str)) { appendPQExpBufferStr(buf, str); return;