From cdc70597c9ba62aad08a46e55c0c783bf4c21c9c Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue, 6 Sep 2016 14:53:31 -0400
Subject: [PATCH] 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.
---
 src/fe_utils/string_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
GitLab