Teach appendShellString() to not quote strings containing "-".
authorTom Lane <[email protected]>
Tue, 6 Sep 2016 18:53:31 +0000 (14:53 -0400)
committerTom Lane <[email protected]>
Tue, 6 Sep 2016 18:53:31 +0000 (14:53 -0400)
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.

src/fe_utils/string_utils.c

index edbc869e4534c39d248cec8a0f2a5bb6e3ed8d2e..61bf9e6ca607c9bfbec2ce2f1f6433451719a563 100644 (file)
@@ -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;