/* And try to execute it */
status = exec_command(cmd, scan_state, query_buf);
- if (status == PSQL_CMD_UNKNOWN && strlen(cmd) > 1)
- {
- /*
- * If the command was not recognized, try to parse it as a one-letter
- * command with immediately following argument (a still-supported, but
- * no longer encouraged, syntax).
- */
- char new_cmd[2];
-
- /* don't change cmd until we know it's okay */
- new_cmd[0] = cmd[0];
- new_cmd[1] = '\0';
-
- psql_scan_slash_pushback(scan_state, cmd + 1);
-
- status = exec_command(new_cmd, scan_state, query_buf);
-
- if (status != PSQL_CMD_UNKNOWN)
- {
- /* adjust cmd for possible messages below */
- cmd[1] = '\0';
- }
- }
-
if (status == PSQL_CMD_UNKNOWN)
{
if (pset.cur_cmd_interactive)
/* There are no possible errors in this lex state... */
}
-/*
- * "Push back" the passed string so that it will be rescanned by subsequent
- * psql_scan_slash_option calls. This is presently only used in the case
- * where a single-letter command has been concatenated with its argument.
- *
- * We use the same buffer stack mechanism as for variable expansion.
- */
-void
-psql_scan_slash_pushback(PsqlScanState state, const char *str)
-{
- /* needed for push_new_buffer */
- cur_state = state;
-
- push_new_buffer(str);
-}
-
/*
* Push the given string onto the stack of stuff to scan.