summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authoriggy@mysql.com <>2006-06-29 17:06:28 -0400
committeriggy@mysql.com <>2006-06-29 17:06:28 -0400
commitf6658356c6c53e003a07219e2ee627bb860a9575 (patch)
treef528e83be3314db65be54167c7cf50424497c8d7 /client
parente343c0e2140d62e88798d813ad518e4ad4417e6e (diff)
downloadmariadb-git-f6658356c6c53e003a07219e2ee627bb860a9575.tar.gz
Bug#20328 mysql client: dumb about trailing spaces on help command.
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 2f9031b84b8..fa7961b4acd 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1725,7 +1725,14 @@ static int com_server_help(String *buffer __attribute__((unused)),
if (help_arg[0] != '\'')
{
- (void) strxnmov(cmd_buf, sizeof(cmd_buf), "help '", help_arg, "'", NullS);
+ char *end_arg= strend(help_arg);
+ if(--end_arg)
+ {
+ while (my_isspace(charset_info,*end_arg))
+ end_arg--;
+ *++end_arg= '\0';
+ }
+ (void) strxnmov(cmd_buf, sizeof(cmd_buf), "help '", help_arg, "'", NullS);
server_cmd= cmd_buf;
}
@@ -1811,9 +1818,13 @@ com_help(String *buffer __attribute__((unused)),
{
reg1 int i, j;
char * help_arg= strchr(line,' '), buff[32], *end;
-
if (help_arg)
- return com_server_help(buffer,line,help_arg+1);
+ {
+ while (my_isspace(charset_info,*help_arg))
+ help_arg++;
+ if (*help_arg)
+ return com_server_help(buffer,line,help_arg);
+ }
put_info("\nFor information about MySQL products and services, visit:\n"
" http://www.mysql.com/\n"