From be545eaf73bc0ac2d6b2f311f8c333e76a348181 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Mon, 26 Nov 2001 19:30:58 +0000
Subject: [PATCH] Fix for "--" options.  Allow --xxx as a valid flag, from
 NetBSD fix.

---
 src/utils/getopt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/utils/getopt.c b/src/utils/getopt.c
index 442631347c5..bbe81c16990 100644
--- a/src/utils/getopt.c
+++ b/src/utils/getopt.c
@@ -71,7 +71,7 @@ const char *ostr;
 			place = EMSG;
 			return -1;
 		}
-		if (place[1] && *++place == '-')
+		if (place[1] && *++place == '-' && place[1] == '\0')
 		{						/* found "--" */
 			++optind;
 			place = EMSG;
-- 
GitLab