[w3m-dev 03730] display decoded URL
* anchor.c (link_list_panel): support DecodeURL * display.c (make_lastline_link): support DecodeURL * etc.c (url_unquote_conv): added * fm.h (DecodeURL): added * history.c (historyBuffer): support DecodeURL * indep.c (QUOTE_MAP): added (HTML_QUOTE_MAP): added (html_quote_char): deleted (url_quote): use is_url_quote (file_quote): use is_file_quote (is_url_safe): deleted (Str_form_quote): use is_url_unsafe (Str_url_unquote): add safe args (is_shell_safe): delete (shell_quote): use is_shell_unsafe * indep.h (QUOTE_MAP): added (HTML_QUOTE_MAP): added (HTML_QUOTE_MASK): added (SHELL_UNSAFE_MASK): added (URL_QUOTE_MASK): added (FILE_QUOTE_MASK): added (URL_UNSAFE_MASK): added (GET_QUOTE_TYPE): added (is_html_quote): added (is_shell_unsafe): added (is_url_quote): added (is_file_quote): added (is_url_unsafe): added (html_quote_char): added (html_quote_char): deleted (Str_url_unquote): added safe (form_unquote): Str_url_unquote changes * linein.c (_prev): support DecodeURL (_next): ditto * main.c (goURL0): support DecodeURL (_peekURL): ditto (curURL): ditto * map.c (follow_map_panel): support DecodeURL (append_map_info): ditto (append_link_info): ditto (append_frame_info): ditto (page_info_panel): ditto * menu.c (initSelectMenu): delete SCM_LOCAL_CGI support DecodeURL (initSelTabMenu): delete SCM_LOCAL_CGI support DecodeURL (link_menu): support DecodeURL * parsetagx.c (parse_tag): is_html_quote * proto.h (url_unquote_conv): added * rc.c (CMT_DECODE_URL): added (params1): add decode_url * url.c (openURL): Str_url_unquote non safe From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
27
display.c
27
display.c
@@ -1,4 +1,4 @@
|
||||
/* $Id: display.c,v 1.61 2003/02/03 15:49:21 ukai Exp $ */
|
||||
/* $Id: display.c,v 1.62 2003/02/05 16:43:57 ukai Exp $ */
|
||||
#include <signal.h>
|
||||
#include "fm.h"
|
||||
|
||||
@@ -235,9 +235,12 @@ static Str
|
||||
make_lastline_link(Buffer *buf, char *title, char *url)
|
||||
{
|
||||
Str s = NULL, u;
|
||||
#ifdef JP_CHARSET
|
||||
Lineprop *pr;
|
||||
#endif
|
||||
ParsedURL pu;
|
||||
char *p;
|
||||
int l = COLS - 1;
|
||||
int l = COLS - 1, i;
|
||||
|
||||
if (title && *title) {
|
||||
s = Strnew_m_charp("[", title, "]", NULL);
|
||||
@@ -255,6 +258,11 @@ make_lastline_link(Buffer *buf, char *title, char *url)
|
||||
return s;
|
||||
parseURL2(url, &pu, baseURL(buf));
|
||||
u = parsedURL2Str(&pu);
|
||||
if (DecodeURL)
|
||||
u = Strnew_charp(url_unquote_conv(u->ptr, Currentbuf->document_code));
|
||||
#ifdef JP_CHARSET
|
||||
u = checkType(u, &pr, NULL);
|
||||
#endif
|
||||
if (l <= 4 || l >= u->length) {
|
||||
if (!s)
|
||||
return u;
|
||||
@@ -263,14 +271,23 @@ make_lastline_link(Buffer *buf, char *title, char *url)
|
||||
}
|
||||
if (!s)
|
||||
s = Strnew_size(COLS);
|
||||
Strcat_charp_n(s, u->ptr, (l - 2) / 2);
|
||||
i = (l - 2) / 2;
|
||||
#ifdef JP_CHARSET
|
||||
if (CharType(pr[i]) == PC_KANJI2)
|
||||
i--;
|
||||
#endif
|
||||
Strcat_charp_n(s, u->ptr, i);
|
||||
#if LANG == JA
|
||||
Strcat_charp(s, "¡Ä");
|
||||
#else /* LANG != JA */
|
||||
Strcat_charp(s, "..");
|
||||
#endif /* LANG != JA */
|
||||
l = COLS - 1 - s->length;
|
||||
Strcat_charp(s, &u->ptr[u->length - l]);
|
||||
i = u->length - (COLS - 1 - s->length);
|
||||
#ifdef JP_CHARSET
|
||||
if (CharType(pr[i]) == PC_KANJI2)
|
||||
i++;
|
||||
#endif
|
||||
Strcat_charp(s, &u->ptr[i]);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user