diff options
author | Julius Goryavsky <julius.goryavsky@mariadb.com> | 2021-12-23 14:14:04 +0100 |
---|---|---|
committer | Julius Goryavsky <julius.goryavsky@mariadb.com> | 2021-12-23 14:14:04 +0100 |
commit | 3376668ca8799f2dc79b3d71a55c062d55e0f09b (patch) | |
tree | 5b61e2482ea1829c2722faa6e0d5b0e4ee4b25c2 /client/mysql.cc | |
parent | a5ef74e7eb4bab09c9bda4fcd7fab12302526ea4 (diff) | |
parent | 12087d67579e641cfc07ee6b8c46b75171e9708c (diff) | |
download | mariadb-git-3376668ca8799f2dc79b3d71a55c062d55e0f09b.tar.gz |
Merge branch 10.2 into 10.3
Diffstat (limited to 'client/mysql.cc')
-rw-r--r-- | client/mysql.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index e1069017c82..558b54e3909 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -99,8 +99,8 @@ extern "C" { # endif # endif #define HAVE_READLINE -#define USE_POPEN #endif +#define USE_POPEN } #ifdef HAVE_VIDATTR @@ -4195,11 +4195,6 @@ com_nopager(String *buffer __attribute__((unused)), } #endif - -/* - Sorry, you can't send the result to an editor in Win32 -*/ - #ifdef USE_POPEN static int com_edit(String *buffer,char *line __attribute__((unused))) @@ -4220,7 +4215,7 @@ com_edit(String *buffer,char *line __attribute__((unused))) if (!(editor = (char *)getenv("EDITOR")) && !(editor = (char *)getenv("VISUAL"))) - editor = "vi"; + editor = IF_WIN("notepad","vi"); strxmov(buff,editor," ",filename,NullS); if ((error= system(buff))) { @@ -4235,7 +4230,7 @@ com_edit(String *buffer,char *line __attribute__((unused))) if ((fd = my_open(filename,O_RDONLY, MYF(MY_WME))) < 0) goto err; (void) buffer->alloc((uint) stat_arg.st_size); - if ((tmp=read(fd,(char*) buffer->ptr(),buffer->alloced_length())) >= 0L) + if ((tmp=(int)my_read(fd,(uchar*) buffer->ptr(),buffer->alloced_length(),MYF(0))) >= 0) buffer->length((uint) tmp); else buffer->length(0); |