[w3m-dev 02640]

From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2001-12-07 07:24:22 +00:00
parent 141ac414c5
commit 8b13540fb8
2 changed files with 35 additions and 16 deletions

View File

@@ -1,3 +1,9 @@
2001-12-07 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 02640]
* linein.c (escape_spaces): rewrite
* linein.c (unescape_spaces): rewrite
2001-12-07 Tsutomu Okada <okada@furuno.co.jp> 2001-12-07 Tsutomu Okada <okada@furuno.co.jp>
* [w3m-dev 02638] completion for ! and/or @ * [w3m-dev 02638] completion for ! and/or @
@@ -1080,4 +1086,4 @@
* release-0-2-1 * release-0-2-1
* import w3m-0.2.1 * import w3m-0.2.1
$Id: ChangeLog,v 1.112 2001/12/07 07:20:26 ukai Exp $ $Id: ChangeLog,v 1.113 2001/12/07 07:24:22 ukai Exp $

View File

@@ -1,4 +1,4 @@
/* $Id: linein.c,v 1.13 2001/12/07 07:20:26 ukai Exp $ */ /* $Id: linein.c,v 1.14 2001/12/07 07:24:22 ukai Exp $ */
#include "fm.h" #include "fm.h"
#include "local.h" #include "local.h"
#include "myctype.h" #include "myctype.h"
@@ -855,37 +855,50 @@ next_dcompl(int next)
} }
} }
Str Str
escape_spaces(Str s) escape_spaces(Str s)
{ {
Str tmp = NULL;
char *p; char *p;
if (s == NULL) if (s == NULL)
return; return s;
p = s->ptr; for (p = s->ptr; *p; p++) {
s = Strnew(); if (*p == ' ' || *p == CTRL_I) {
while(*p) { if (tmp == NULL)
if (*p == ' ') tmp = Strnew_charp_n(s->ptr, (int)(p - s->ptr));
Strcat_char(s, '\\'); Strcat_char(tmp, '\\');
Strcat_char(s, *p++); }
if (tmp)
Strcat_char(tmp, *p);
} }
if (tmp)
return tmp;
return s; return s;
} }
Str Str
unescape_spaces(Str s) unescape_spaces(Str s)
{ {
Str tmp = NULL;
char *p; char *p;
if (s == NULL) if (s == NULL)
return; return s;
p = s->ptr; for (p = s->ptr; *p; p++) {
s = Strnew(); if (*p == '\\' && (*(p+1) == ' ' || *(p+1) == CTRL_I)) {
while (*p) { if (tmp == NULL)
if (!(*p == '\\' && *(p+1) && *(p+1) == ' ')) tmp = Strnew_charp_n(s->ptr, (int)(p - s->ptr));
Strcat_char(s, *p); }
p++; else {
if (tmp)
Strcat_char(tmp, *p);
}
} }
if (tmp)
return tmp;
return s; return s;
} }