*** pgsql/src/bin/psql/command.c 2010/04/03 20:55:57 1.218 --- pgsql/src/bin/psql/command.c 2010/05/08 16:39:51 1.219 *************** *** 3,9 **** * * Copyright (c) 2000-2010, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.217 2010/03/08 23:03:00 momjian Exp $ */ #include "postgres_fe.h" #include "command.h" --- 3,9 ---- * * Copyright (c) 2000-2010, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.218 2010/04/03 20:55:57 tgl Exp $ */ #include "postgres_fe.h" #include "command.h" *************** exec_command(const char *cmd, *** 651,656 **** --- 651,663 ---- { char *opt = psql_scan_slash_option(scan_state, OT_WHOLE_LINE, NULL, false); + size_t len; + + /* strip any trailing spaces and semicolons */ + len = strlen(opt); + while (len > 0 && + (isspace((unsigned char) opt[len - 1]) || opt[len - 1] == ';')) + opt[--len] = '\0'; helpSQL(opt, pset.popt.topt.pager); free(opt);