psql: fix \copy stdin trailing space requirement
authorBruce Momjian
Tue, 10 Sep 2013 23:36:10 +0000 (19:36 -0400)
committerBruce Momjian
Tue, 10 Sep 2013 23:36:10 +0000 (19:36 -0400)
Previously a trailing space was required for \copy ... stdin:

copy foo from stdin ;

Etsuro Fujita

src/bin/psql/copy.c

index c1e7cfeb8af75441513821f5b29871bb50fa8b90..13123d600dbb89dd84fc49561a8c662ce2fe9bbf 100644 (file)
@@ -196,7 +196,7 @@ parse_slash_copy(const char *args)
        goto error;
 
    /* { 'filename' | PROGRAM 'command' | STDIN | STDOUT | PSTDIN | PSTDOUT } */
-   token = strtokx(NULL, whitespace, NULL, "'",
+   token = strtokx(NULL, whitespace, ";", "'",
                    0, false, false, pset.encoding);
    if (!token)
        goto error;
@@ -205,7 +205,7 @@ parse_slash_copy(const char *args)
    {
        int         toklen;
 
-       token = strtokx(NULL, whitespace, NULL, "'",
+       token = strtokx(NULL, whitespace, ";", "'",
                        0, false, false, pset.encoding);
        if (!token)
            goto error;