summaryrefslogtreecommitdiff
path: root/client/mysql.cc
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2021-12-26 12:51:04 +0100
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2021-12-26 12:51:04 +0100
commit55bb933a880bf048ebc4ce6c6e239dcc8268958d (patch)
treea3a24c56995df41758205f8f6a4e3cbccf793a19 /client/mysql.cc
parentbe20b3b03f9c522d17b3454214981506549063eb (diff)
parent681b7784b6bb3d735d0a745f5891844f43becc90 (diff)
downloadmariadb-git-55bb933a880bf048ebc4ce6c6e239dcc8268958d.tar.gz
Merge branch 10.4 into 10.5st-10.5-julius
Diffstat (limited to 'client/mysql.cc')
-rw-r--r--client/mysql.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 00590868309..15325aec69d 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -100,8 +100,8 @@ extern "C" {
# endif
# endif
#define HAVE_READLINE
-#define USE_POPEN
#endif
+#define USE_POPEN
}
#ifdef HAVE_VIDATTR
@@ -4202,11 +4202,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)))
@@ -4227,7 +4222,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)))
{
@@ -4242,7 +4237,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);