Commit db12a63e authored by Bruce Momjian's avatar Bruce Momjian

The \p\g fix didn't turn out to be so bad. It even works in other

circumstances:
=> select * from foo\x\t\pset border 0 \p\g\\select * from bar;

Also the release prep update so the sql_help.h is generated before
packaging.

Peter.
parent d286f13b
...@@ -58,7 +58,8 @@ static bool ...@@ -58,7 +58,8 @@ static bool
* Handles all the different commands that start with '\', * Handles all the different commands that start with '\',
* ordinarily called by MainLoop(). * ordinarily called by MainLoop().
* *
* 'line' is the current input line, which must start with a '\' * 'line' is the current input line, which should not start with a '\'
* but with the actual command name
* (that is taken care of by MainLoop) * (that is taken care of by MainLoop)
* *
* 'query_buf' contains the query-so-far, which may be modified by * 'query_buf' contains the query-so-far, which may be modified by
...@@ -89,16 +90,22 @@ HandleSlashCmds(PsqlSettings *pset, ...@@ -89,16 +90,22 @@ HandleSlashCmds(PsqlSettings *pset,
my_line = xstrdup(line); my_line = xstrdup(line);
/* /*
* Find the first whitespace (or backslash) line[blank_loc] will now * Find the first whitespace. line[blank_loc] will now
* be the whitespace character or the \0 at the end * be the whitespace character or the \0 at the end
*
* Also look for a backslash, so stuff like \p\g works.
*/ */
blank_loc = strcspn(my_line, " \t"); blank_loc = strcspn(my_line, " \t\\");
if (my_line[blank_loc] == '\\')
{
continue_parse = &my_line[blank_loc];
my_line[blank_loc] = '\0';
}
/* do we have an option string? */ /* do we have an option string? */
if (my_line[blank_loc] != '\0') else if (my_line[blank_loc] != '\0')
{ {
options_string = &my_line[blank_loc + 1]; options_string = &my_line[blank_loc + 1];
my_line[blank_loc] = '\0'; my_line[blank_loc] = '\0';
} }
...@@ -198,7 +205,6 @@ HandleSlashCmds(PsqlSettings *pset, ...@@ -198,7 +205,6 @@ HandleSlashCmds(PsqlSettings *pset,
} }
cmd = my_line; cmd = my_line;
status = exec_command(cmd, options, options_string, query_buf, pset); status = exec_command(cmd, options, options_string, query_buf, pset);
if (status == CMD_UNKNOWN) if (status == CMD_UNKNOWN)
......
This diff is collapsed.
...@@ -51,6 +51,16 @@ $MAKE preproc.c preproc.h pgc.c ...@@ -51,6 +51,16 @@ $MAKE preproc.c preproc.h pgc.c
cd ../../.. cd ../../..
# Generate psql's help on SQL command from the SGML docs
cd bin/psql
rm -f sql_help.h
$MAKE sql_help.h
cd ../..
# Clean up # Clean up
$MAKE distclean $MAKE distclean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment