aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-06-09 16:09:24 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-06-09 16:09:24 +0000
commit1756f4887ec0bbb61f8dd2233c0d45a391d485d3 (patch)
tree21a8def7083746ea1af619e6bcda3e68759d7d8d /main.c
parent[w3m-dev 03207] strchr(), strcasecmp(), and strncasecmp() (diff)
downloadw3m-1756f4887ec0bbb61f8dd2233c0d45a391d485d3.tar.gz
w3m-1756f4887ec0bbb61f8dd2233c0d45a391d485d3.zip
[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 (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/main.c b/main.c
index 3ecd489..8338db4 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.106 2002/06/05 15:42:10 ukai Exp $ */
+/* $Id: main.c,v 1.107 2002/06/09 16:09:25 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -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;