diff options
author | unknown <jani@hynda.mysql.fi> | 2002-02-15 02:34:48 +0200 |
---|---|---|
committer | unknown <jani@hynda.mysql.fi> | 2002-02-15 02:34:48 +0200 |
commit | a95fba4d22014173aeeda005d65b43ce3fd8f7c2 (patch) | |
tree | a98e050c0adf66fecacd97a90e143e27b541a0cf /client | |
parent | 4c164621185c8493de06281ae68ef35f977c13a9 (diff) | |
download | mariadb-git-a95fba4d22014173aeeda005d65b43ce3fd8f7c2.tar.gz |
Fixed too bugs in MySQL client 'mysql', interactive command 'tee'.
client/mysql.cc:
Fixed two bugs in 'tee'.
It's now possible to change the 'tee-file' on the fly without
need to run 'notee' in between. 'tee' will now also accept quotes
around the file name.
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index cfe6d823cac..ab8740dbe3c 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -34,7 +34,7 @@ #include "my_readline.h" #include <signal.h> -const char *VER="11.16"; +const char *VER="11.17"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 @@ -1776,10 +1776,17 @@ com_tee(String *buffer, char *line __attribute__((unused))) { while (isspace(*param)) param++; - end=strmake(file_name, param, sizeof(file_name)-1); + end= strend(param); while (end > file_name && (isspace(end[-1]) || iscntrl(end[-1]))) end--; - end[0]=0; + end[0]= 0; + if ((*(end - 1) == '"' && *param == '"') || + (*(end - 1) == '\'' && *param == '\'')) + { + *--end= 0; + param++; + } + strmake(file_name, param, sizeof(file_name) - 1); strmov(outfile, file_name); } if (!strlen(outfile)) @@ -1787,11 +1794,10 @@ com_tee(String *buffer, char *line __attribute__((unused))) printf("No outfile specified!\n"); return 0; } - if (!opt_outfile) - { - init_tee(); - opt_outfile=1; - } + if (opt_outfile) + end_tee(); + init_tee(); + opt_outfile= 1; tee_fprintf(stdout, "Logging to file '%s'\n", outfile); return 0; } |