From d9df7d34cabc7ea723865f56e131db4d73bb0898 Mon Sep 17 00:00:00 2001
From: Nirbhay Choubey <nirbhay@mariadb.com>
Date: Thu, 7 May 2015 21:44:34 -0400
Subject: [PATCH] Bug#68925: Compatibility issue with mysql history ("\040"
 instead of space)

Problem: libedit encodes whitespace characters before dumping them to history file.

Fix: Be readline-friendly, do not encode whitespace characters.
---
 cmd-line-utils/libedit/history.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd-line-utils/libedit/history.c b/cmd-line-utils/libedit/history.c
index 6d2176c258b3..6f9be53fc32a 100644
--- a/cmd-line-utils/libedit/history.c
+++ b/cmd-line-utils/libedit/history.c
@@ -827,7 +827,7 @@ history_save(TYPE(History) *h, const char *fname)
 			}
 			ptr = nptr;
 		}
-		(void) strvis(ptr, str, VIS_WHITE);
+		(void) strvis(ptr, str, VIS_SAFE);
 		(void) fprintf(fp, "%s\n", ptr);
 	}
 oomem: