summaryrefslogtreecommitdiff
path: root/client/mysql.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-01-04 09:26:38 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-01-04 09:26:38 +0200
commit3f5726768f17342fd6dfec1be1e4d71814bc8564 (patch)
treecc85210cf84b11f0543d9a20bcb78f40cb32c140 /client/mysql.cc
parentc410f7aaea400eb98f13552725b685a2513aafcb (diff)
parent4c3ad24413f234599eda27f4958dd3ff21df3203 (diff)
downloadmariadb-git-3f5726768f17342fd6dfec1be1e4d71814bc8564.tar.gz
Merge 10.5 into 10.6
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 ee963b9220d..37f506a99cd 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
@@ -4269,11 +4269,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)))
@@ -4294,7 +4289,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)))
{
@@ -4309,7 +4304,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);