From 9af4159fce6654aa0e081b00d02bca40b978745c Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 29 May 2013 16:58:43 -0400 Subject: pgindent run for release 9.3 This is the first run of the Perl-based pgindent script. Also update pgindent instructions. --- src/bin/psql/copy.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/bin/psql/copy.c') diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c index 57cbf928161..b5732c79709 100644 --- a/src/bin/psql/copy.c +++ b/src/bin/psql/copy.c @@ -35,7 +35,7 @@ * \copy ( select stmt ) to filename [options] * * where 'filename' can be one of the following: - * '' | PROGRAM '' | stdin | stdout | pstdout | pstdout + * '' | PROGRAM '' | stdin | stdout | pstdout | pstdout * * An undocumented fact is that you can still write BINARY before the * tablename; this is a hangover from the pre-7.3 syntax. The options @@ -203,7 +203,7 @@ parse_slash_copy(const char *args) if (pg_strcasecmp(token, "program") == 0) { - int toklen; + int toklen; token = strtokx(NULL, whitespace, NULL, "'", 0, false, false, pset.encoding); @@ -211,8 +211,8 @@ parse_slash_copy(const char *args) goto error; /* - * The shell command must be quoted. This isn't fool-proof, but catches - * most quoting errors. + * The shell command must be quoted. This isn't fool-proof, but + * catches most quoting errors. */ toklen = strlen(token); if (token[0] != '\'' || toklen < 2 || token[toklen - 1] != '\'') @@ -381,7 +381,8 @@ do_copy(const char *args) { if (options->program) { - int pclose_rc = pclose(copystream); + int pclose_rc = pclose(copystream); + if (pclose_rc != 0) { if (pclose_rc < 0) @@ -389,7 +390,8 @@ do_copy(const char *args) strerror(errno)); else { - char *reason = wait_result_to_str(pclose_rc); + char *reason = wait_result_to_str(pclose_rc); + psql_error("%s: %s\n", options->file, reason ? reason : ""); if (reason) -- cgit v1.2.3