[w3m-dev 03093] Re: gopher broken
(Re: Bug#137287: w3m: segfault on gopher://xxxx.xxx URI) * file.c (loadGopherDir): fix ->ptr q should be url_quote() * url.c (openURL): url_unquote() for gopher selector From: Fumitoshi UKAI <ukai@debian.or.jp>
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2002-03-09 Fumitoshi UKAI <ukai@debian.or.jp>
|
||||
|
||||
* [w3m-dev 03093] Re: gopher broken
|
||||
(Re: Bug#137287: w3m: segfault on gopher://xxxx.xxx URI)
|
||||
* file.c (loadGopherDir): fix ->ptr
|
||||
q should be url_quote()
|
||||
* url.c (openURL): url_unquote() for gopher selector
|
||||
|
||||
2002-03-09 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
||||
|
||||
* [w3m-dev 03090] Re: gopher broken
|
||||
@@ -3082,4 +3090,4 @@
|
||||
* release-0-2-1
|
||||
* import w3m-0.2.1
|
||||
|
||||
$Id: ChangeLog,v 1.337 2002/03/08 15:16:02 ukai Exp $
|
||||
$Id: ChangeLog,v 1.338 2002/03/08 15:59:25 ukai Exp $
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: file.c,v 1.76 2002/03/08 15:16:02 ukai Exp $ */
|
||||
/* $Id: file.c,v 1.77 2002/03/08 15:59:25 ukai Exp $ */
|
||||
#include "fm.h"
|
||||
#include <sys/types.h>
|
||||
#include "myctype.h"
|
||||
@@ -6201,7 +6201,7 @@ loadHTMLString(Str page)
|
||||
* loadGopherDir: get gopher directory
|
||||
*/
|
||||
Buffer *
|
||||
loadGopherDir(URLFile *uf, Buffer * volatile newBuf)
|
||||
loadGopherDir(URLFile *uf, Buffer *volatile newBuf)
|
||||
{
|
||||
Str tmp, lbuf, name, file, host, port;
|
||||
char code;
|
||||
@@ -6252,7 +6252,7 @@ loadGopherDir(URLFile *uf, Buffer * volatile newBuf)
|
||||
if (!*q)
|
||||
continue;
|
||||
p = q + 1;
|
||||
for (q = p; *q && *q != '\t'&& *q != '\r' && *q != '\n'; q++) ;
|
||||
for (q = p; *q && *q != '\t' && *q != '\r' && *q != '\n'; q++) ;
|
||||
port = Strnew_charp_n(p, q - p);
|
||||
|
||||
switch (name->ptr[0]) {
|
||||
@@ -6278,8 +6278,9 @@ loadGopherDir(URLFile *uf, Buffer * volatile newBuf)
|
||||
p = "[unsupported]";
|
||||
break;
|
||||
}
|
||||
q = Strnew_m_charp("gopher://", host, ":", port, "/", file, NULL)->ptr;
|
||||
Strcat_m_charp(tmp, "<a href=\"", html_quote(q), "\">", p,
|
||||
q = Strnew_m_charp("gopher://", host->ptr, ":", port->ptr,
|
||||
"/", file->ptr, NULL)->ptr;
|
||||
Strcat_m_charp(tmp, "<a href=\"", url_quote(q), "\">", p,
|
||||
html_quote(name->ptr + 1), "</a>\n", NULL);
|
||||
}
|
||||
|
||||
@@ -6458,16 +6459,16 @@ loadImageBuffer(URLFile *uf, Buffer *newBuf)
|
||||
tmp = Sprintf("<img src=\"%s\"><br><br>", html_quote(image->url));
|
||||
if (newBuf == NULL)
|
||||
newBuf = newBuffer(INIT_BUFFER_WIDTH);
|
||||
/*
|
||||
if (frame_source) {
|
||||
*/
|
||||
/*
|
||||
* if (frame_source) {
|
||||
*/
|
||||
tmpf = tmpfname(TMPF_SRC, ".html");
|
||||
src = fopen(tmpf->ptr, "w");
|
||||
newBuf->sourcefile = tmpf->ptr;
|
||||
pushText(fileToDelete, tmpf->ptr);
|
||||
/*
|
||||
}
|
||||
*/
|
||||
/*
|
||||
* }
|
||||
*/
|
||||
init_stream(&f, SCM_LOCAL, newStrStream(tmp));
|
||||
loadHTMLstream(&f, newBuf, src, TRUE);
|
||||
if (src)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: url.c,v 1.47 2002/03/06 03:32:11 ukai Exp $ */
|
||||
/* $Id: url.c,v 1.48 2002/03/08 15:59:25 ukai Exp $ */
|
||||
#include "fm.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -1677,7 +1677,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
|
||||
return uf;
|
||||
if (pu->file == NULL)
|
||||
pu->file = "1";
|
||||
tmp = Strnew_charp(pu->file);
|
||||
tmp = Strnew_charp(url_unquote(pu->file));
|
||||
Strcat_char(tmp, '\n');
|
||||
}
|
||||
write(sock, tmp->ptr, tmp->length);
|
||||
|
||||
Reference in New Issue
Block a user