diff options
author | unknown <vva@eagle.mysql.r18.ru> | 2004-08-27 20:32:28 +0500 |
---|---|---|
committer | unknown <vva@eagle.mysql.r18.ru> | 2004-08-27 20:32:28 +0500 |
commit | 46eefa9f7c18816b81ced4821e86fcae67e4b7e7 (patch) | |
tree | e9213413f84126db558204251f61c9912bb7edb0 | |
parent | b7709f3384d2708a4426eebda692508d7b6034e8 (diff) | |
download | mariadb-git-46eefa9f7c18816b81ced4821e86fcae67e4b7e7.tar.gz |
fixed format of history of new libedit for compatibility
with old libedit and readline
1. discarded reading and writting of hist_cookie as the begin of the file
2. skip strvis for string before saving
cmd-line-utils/libedit/history.c:
fixed format of history for compatibility with old libedit and readline
1. discarded reading and writting of hist_cookie as the begin of file
2. skip strvis for string before saving
-rw-r--r-- | cmd-line-utils/libedit/history.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/cmd-line-utils/libedit/history.c b/cmd-line-utils/libedit/history.c index 0294734b9a3..53648203bf0 100644 --- a/cmd-line-utils/libedit/history.c +++ b/cmd-line-utils/libedit/history.c @@ -661,12 +661,6 @@ history_load(History *h, const char *fname) if ((fp = fopen(fname, "r")) == NULL) return (i); - if ((line = fgetln(fp, &sz)) == NULL) - goto done; - - if (strncmp(line, hist_cookie, sz) != 0) - goto done; - ptr = h_malloc(max_size = 1024); if (ptr == NULL) goto done; @@ -720,8 +714,6 @@ history_save(History *h, const char *fname) if (fchmod(fileno(fp), S_IRUSR|S_IWUSR) == -1) goto done; - if (fputs(hist_cookie, fp) == EOF) - goto done; ptr = h_malloc(max_size = 1024); if (ptr == NULL) goto done; @@ -740,7 +732,7 @@ history_save(History *h, const char *fname) ptr = nptr; } (void) strvis(ptr, ev.str, VIS_WHITE); - (void) fprintf(fp, "%s\n", ptr); + (void) fprintf(fp, "%s\n", ev.str); } oomem: h_free((ptr_t)ptr); |