w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 186bc3752f1bef129209caa01ad2637fd885c6b9
parent 0c77e08525687d1418bb8e787f1b0b1cc0df28f6
Author: ukai <ukai>
Date:   Sun,  9 Jun 2002 16:09:24 +0000

[w3m-dev-en 00751] Re: tab completion weirdness in w3m 0.3
* main.c (svBuf): unescape spaces when input is filename
* proto.h (unescape_spaces): added
From: Kiyokazu SUTO <suto@ks-and-ks.ne.jp>

Diffstat:
MChangeLog | 6++++++
Mmain.c | 19+++++++++++--------
Mproto.h | 1+
3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,9 @@ +2002-06-10 Kiyokazu SUTO <suto@ks-and-ks.ne.jp> + + * [w3m-dev-en 00751] Re: tab completion weirdness in w3m 0.3 + * main.c (svBuf): unescape spaces when input is filename + * proto.h (unescape_spaces): added + 2002-06-08 Kiyokazu SUTO <suto@ks-and-ks.ne.jp> * [w3m-dev 03207] strchr(), strcasecmp(), and strncasecmp() diff --git a/main.c b/main.c @@ -3971,26 +3971,29 @@ svI(void) void svBuf(void) { - char *file; + char *qfile = NULL, *file; FILE *f; int is_pipe; CurrentKeyData = NULL; /* not allowed in w3m-control: */ file = searchKeyData(); if (file == NULL || *file == '\0') { - file = inputLineHist("Save buffer to: ", NULL, IN_COMMAND, SaveHist); - } - if (file != NULL) - file = conv_to_system(file); - if (file == NULL || *file == '\0') { - displayBuffer(Currentbuf, B_FORCE_REDRAW); - return; + qfile = inputLineHist("Save buffer to: ", NULL, IN_COMMAND, SaveHist); + if (qfile == NULL || *qfile == '\0') { + displayBuffer(Currentbuf, B_FORCE_REDRAW); + return; + } } + file = conv_to_system(qfile ? qfile : file); if (*file == '|') { is_pipe = TRUE; f = popen(file + 1, "w"); } else { + if (qfile) { + file = unescape_spaces(Strnew_charp(qfile))->ptr; + file = conv_to_system(file); + } file = expandName(file); if (checkOverWrite(file) < 0) return; diff --git a/proto.h b/proto.h @@ -293,6 +293,7 @@ extern void escdmap(char c); extern char *inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist, int (*incfunc) (int ch, Str buf, Lineprop *prop)); +extern Str unescape_spaces(Str s); #ifdef USE_HISTORY extern Buffer *historyBuffer(Hist *hist); extern void loadHistory(Hist *hist);