diff options
Diffstat (limited to 'client/mysql.cc')
-rw-r--r-- | client/mysql.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index dc7022a0ffa..bafd173343e 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -86,7 +86,7 @@ extern "C" { #endif #undef bcmp // Fix problem with new readline -#if defined( __WIN__) +#if defined(__WIN__) #include <conio.h> #elif !defined(__NETWARE__) #include <readline/readline.h> @@ -106,7 +106,7 @@ extern "C" { #define cmp_database(cs,A,B) strcmp((A),(B)) #endif -#if !defined( __WIN__) && !defined(__NETWARE__) && !defined(THREAD) +#if !defined(__WIN__) && !defined(__NETWARE__) && !defined(THREAD) #define USE_POPEN #endif @@ -1862,7 +1862,7 @@ static int read_and_execute(bool interactive) if (opt_outfile && glob_buffer.is_empty()) fflush(OUTFILE); -#if defined( __WIN__) || defined(__NETWARE__) +#if defined(__WIN__) || defined(__NETWARE__) tee_fputs(prompt, stdout); #if defined(__NETWARE__) line=fgets(linebuffer, sizeof(linebuffer)-1, stdin); @@ -1873,7 +1873,7 @@ static int read_and_execute(bool interactive) if (p != NULL) *p = '\0'; } -#else defined(__WIN__) +#else if (!tmpbuf.is_alloced()) tmpbuf.alloc(65535); tmpbuf.length(0); @@ -1899,7 +1899,7 @@ static int read_and_execute(bool interactive) if (opt_outfile) fputs(prompt, OUTFILE); line= readline(prompt); -#endif /* defined( __WIN__) || defined(__NETWARE__) */ +#endif /* defined(__WIN__) || defined(__NETWARE__) */ /* When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS @@ -1947,10 +1947,10 @@ static int read_and_execute(bool interactive) } } -#if defined( __WIN__) || defined(__NETWARE__) +#if defined(__WIN__) || defined(__NETWARE__) buffer.free(); #endif -#if defined( __WIN__) +#if defined(__WIN__) tmpbuf.free(); #endif @@ -3819,7 +3819,8 @@ com_edit(String *buffer,char *line __attribute__((unused))) !(editor = (char *)getenv("VISUAL"))) editor = "vi"; strxmov(buff,editor," ",filename,NullS); - (void) system(buff); + if(system(buff) == -1) + goto err; MY_STAT stat_arg; if (!my_stat(filename,&stat_arg,MYF(MY_WME))) @@ -4602,7 +4603,7 @@ void tee_putc(int c, FILE *file) putc(c, OUTFILE); } -#if defined( __WIN__) || defined(__NETWARE__) +#if defined(__WIN__) || defined(__NETWARE__) #include <time.h> #else #include <sys/times.h> @@ -4614,7 +4615,7 @@ void tee_putc(int c, FILE *file) static ulong start_timer(void) { -#if defined( __WIN__) || defined(__NETWARE__) +#if defined(__WIN__) || defined(__NETWARE__) return clock(); #else struct tms tms_tmp; |