aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 8544d15109a..5614120255d 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -777,7 +777,7 @@ exec_command(const char *cmd,
/* \i and \ir include files */
else if (strcmp(cmd, "i") == 0 || strcmp(cmd, "include") == 0
- || strcmp(cmd, "ir") == 0 || strcmp(cmd, "include_relative") == 0)
+ || strcmp(cmd, "ir") == 0 || strcmp(cmd, "include_relative") == 0)
{
char *fname = psql_scan_slash_option(scan_state,
OT_NORMAL, NULL, true);
@@ -789,7 +789,7 @@ exec_command(const char *cmd,
}
else
{
- bool include_relative;
+ bool include_relative;
include_relative = (strcmp(cmd, "ir") == 0
|| strcmp(cmd, "include_relative") == 0);
@@ -1103,16 +1103,16 @@ exec_command(const char *cmd,
else if (strcmp(cmd, "setenv") == 0)
{
char *envvar = psql_scan_slash_option(scan_state,
- OT_NORMAL, NULL, false);
+ OT_NORMAL, NULL, false);
char *envval = psql_scan_slash_option(scan_state,
- OT_NORMAL, NULL, false);
+ OT_NORMAL, NULL, false);
if (!envvar)
{
psql_error("\\%s: missing required argument\n", cmd);
success = false;
}
- else if (strchr(envvar,'=') != NULL)
+ else if (strchr(envvar, '=') != NULL)
{
psql_error("\\%s: environment variable name must not contain \"=\"\n",
cmd);
@@ -1127,16 +1127,17 @@ exec_command(const char *cmd,
else
{
/* Set variable to the value of the next argument */
- int len = strlen(envvar) + strlen(envval) + 1;
+ int len = strlen(envvar) + strlen(envval) + 1;
char *newval = pg_malloc(len + 1);
- snprintf(newval, len+1, "%s=%s", envvar, envval);
+ snprintf(newval, len + 1, "%s=%s", envvar, envval);
putenv(newval);
success = true;
+
/*
- * Do not free newval here, it will screw up the environment
- * if you do. See putenv man page for details. That means we
- * leak a bit of memory here, but not enough to worry about.
+ * Do not free newval here, it will screw up the environment if
+ * you do. See putenv man page for details. That means we leak a
+ * bit of memory here, but not enough to worry about.
*/
}
free(envvar);
@@ -2046,9 +2047,9 @@ process_file(char *filename, bool single_txn, bool use_relative_path)
/*
* If we were asked to resolve the pathname relative to the location
- * of the currently executing script, and there is one, and this is
- * a relative pathname, then prepend all but the last pathname
- * component of the current script to this pathname.
+ * of the currently executing script, and there is one, and this is a
+ * relative pathname, then prepend all but the last pathname component
+ * of the current script to this pathname.
*/
if (use_relative_path && pset.inputfile && !is_absolute_path(filename)
&& !has_drive_prefix(filename))