Fix a corner case when parsing connection strings enclosed with braces.
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Sun, 29 Jan 2017 06:37:45 +0000 (15:37 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Sun, 29 Jan 2017 06:37:45 +0000 (15:37 +0900)
drvconn.c

index 86a04fe8f29234b1f3fe9d48da5c2af398beef5c..8d41884dcaf52591c83b80fcf6aea1079fec12d6 100644 (file)
--- a/drvconn.c
+++ b/drvconn.c
@@ -542,6 +542,7 @@ dconn_get_attributes(copyfunc func, const char *connect_string, ConnInfo *ci)
                        continue;
                    }
                    else if (ATTRIBUTE_DELIMITER == closep[1] ||
+                        '\0' == closep[1] ||
                         delp == closep + 1)
                    {
                        delp = (char *) (closep + 1);
@@ -551,7 +552,7 @@ dconn_get_attributes(copyfunc func, const char *connect_string, ConnInfo *ci)
                            eoftok = TRUE;
                        break;
                    }
-mylog("%s subsequent char to the closing bracket is %c\n", __FUNCTION__, closep[1]);
+mylog("%s subsequent char to the closing bracket is %c value=%s\n", __FUNCTION__, closep[1], value);
                    ret = FALSE;
                    goto cleanup;
                }