aboutsummaryrefslogtreecommitdiffstats
path: root/indep.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-12-09 15:24:00 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-12-09 15:24:00 +0000
commitf9657e4719bd2f0e006a24e9640b89bf051bbf53 (patch)
tree798f224cc08b2de2c94e888f64e1b9d645b2f03b /indep.c
parent[w3m-dev 03541] Re: W3M_LINE_NO / W3M_CURRENT_COLUMN (diff)
downloadw3m-f9657e4719bd2f0e006a24e9640b89bf051bbf53.tar.gz
w3m-f9657e4719bd2f0e006a24e9640b89bf051bbf53.zip
[w3m-dev 03542] news support
* file.c (loadGeneralFile): NNTP as well as NEWS * indep.c (url_unquote_char): check % hex hex (url_unquote): unquote except \0, \n, \r From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--indep.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/indep.c b/indep.c
index cc9185a..1b855bf 100644
--- a/indep.c
+++ b/indep.c
@@ -1,4 +1,4 @@
-/* $Id: indep.c,v 1.25 2002/11/09 21:55:24 ukai Exp $ */
+/* $Id: indep.c,v 1.26 2002/12/09 15:24:04 ukai Exp $ */
#include "fm.h"
#include <stdio.h>
#include <pwd.h>
@@ -506,10 +506,8 @@ html_unquote(char *str)
static char xdigit[0x10] = "0123456789ABCDEF";
#define url_unquote_char(pstr) \
- (IS_XDIGIT((*(pstr))[1]) ? \
- (IS_XDIGIT((*(pstr))[2]) ? \
+ ((IS_XDIGIT((*(pstr))[1]) && IS_XDIGIT((*(pstr))[2])) ? \
(*(pstr) += 3, (GET_MYCDIGIT((*(pstr))[-2]) << 4) | GET_MYCDIGIT((*(pstr))[-1])) : \
- (*(pstr) += 2, GET_MYCDIGIT((*(pstr))[-1]))) : \
-1)
char *
@@ -547,11 +545,10 @@ url_unquote(char *str)
if (*p == '%') {
q = p;
c = url_unquote_char(&q);
- if (c >= 0 && (IS_CNTRL(c) || c == ' ' || !IS_ASCII(c))) {
+ if (c >= 0 && c != '\0' && c != '\n' && c != '\r') {
if (tmp == NULL)
tmp = Strnew_charp_n(str, (int)(p - str));
- if (c != '\0' && c != '\n' && c != '\r')
- Strcat_char(tmp, (char)c);
+ Strcat_char(tmp, (char)c);
p = q;
continue;
}