Merge branch 'bug/sw3m'

This commit is contained in:
Tatsuya Kinoshita
2015-08-11 22:05:46 +09:00
23 changed files with 69 additions and 69 deletions
+4 -10
View File
@@ -530,11 +530,8 @@ Str
Strfgets(FILE * f) Strfgets(FILE * f)
{ {
Str s = Strnew(); Str s = Strnew();
char c; int c;
while (1) { while ((c = fgetc(f)) != EOF) {
c = fgetc(f);
if (feof(f) || ferror(f))
break;
Strcat_char(s, c); Strcat_char(s, c);
if (c == '\n') if (c == '\n')
break; break;
@@ -546,11 +543,8 @@ Str
Strfgetall(FILE * f) Strfgetall(FILE * f)
{ {
Str s = Strnew(); Str s = Strnew();
char c; int c;
while (1) { while ((c = fgetc(f)) != EOF) {
c = fgetc(f);
if (feof(f) || ferror(f))
break;
Strcat_char(s, c); Strcat_char(s, c);
} }
return s; return s;
-2
View File
@@ -643,7 +643,6 @@ addMultirowsForm(Buffer *buf, AnchorList *al)
{ {
int i, j, k, col, ecol, pos; int i, j, k, col, ecol, pos;
Anchor a_form, *a; Anchor a_form, *a;
FormItemList *fi;
Line *l, *ls; Line *l, *ls;
if (al == NULL || al->nanchor == 0) if (al == NULL || al->nanchor == 0)
@@ -670,7 +669,6 @@ addMultirowsForm(Buffer *buf, AnchorList *al)
if (!ls) if (!ls)
continue; continue;
} }
fi = (FormItemList *)a_form.url;
col = COLPOS(ls, a_form.start.pos); col = COLPOS(ls, a_form.start.pos);
ecol = COLPOS(ls, a_form.end.pos); ecol = COLPOS(ls, a_form.end.pos);
for (j = 0; l && j < a_form.rows; l = l->next, j++) { for (j = 0; l && j < a_form.rows; l = l->next, j++) {
+5 -2
View File
@@ -705,6 +705,7 @@ readBufferCache(Buffer *buf)
cache = fopen(buf->savecache, "r"); cache = fopen(buf->savecache, "r");
if (cache == NULL || fread1(clnum, cache) || fread1(tlnum, cache)) { if (cache == NULL || fread1(clnum, cache) || fread1(tlnum, cache)) {
fclose(cache);
buf->savecache = NULL; buf->savecache = NULL;
return -1; return -1;
} }
@@ -760,8 +761,10 @@ readBufferCache(Buffer *buf)
} }
#endif #endif
} }
buf->lastLine = prevl; if (prevl) {
buf->lastLine->next = NULL; buf->lastLine = prevl;
buf->lastLine->next = NULL;
}
fclose(cache); fclose(cache);
unlink(buf->savecache); unlink(buf->savecache);
buf->savecache = NULL; buf->savecache = NULL;
+15 -14
View File
@@ -22,10 +22,10 @@ static int is_saved = 1;
#define contain_no_dots(p, ep) (total_dot_number((p),(ep),1)==0) #define contain_no_dots(p, ep) (total_dot_number((p),(ep),1)==0)
static int static unsigned int
total_dot_number(char *p, char *ep, int max_count) total_dot_number(char *p, char *ep, unsigned int max_count)
{ {
int count = 0; unsigned int count = 0;
if (!ep) if (!ep)
ep = p + strlen(p); ep = p + strlen(p);
@@ -105,6 +105,7 @@ make_portlist(Str port)
pl->next = first; pl->next = first;
first = pl; first = pl;
} }
Strfree(tmp);
return first; return first;
} }
@@ -324,7 +325,7 @@ add_cookie(ParsedURL *pu, Str name, Str value,
if (version == 0) { if (version == 0) {
/* [NETSCAPE] rule */ /* [NETSCAPE] rule */
int n = total_dot_number(domain->ptr, unsigned int n = total_dot_number(domain->ptr,
domain->ptr + domain->length, domain->ptr + domain->length,
3); 3);
if (n < 2) { if (n < 2) {
@@ -517,36 +518,36 @@ load_cookies(void)
cookie->commentURL = NULL; cookie->commentURL = NULL;
parseURL(readcol(&str)->ptr, &cookie->url, NULL); parseURL(readcol(&str)->ptr, &cookie->url, NULL);
if (!*str) if (!*str)
return; break;
cookie->name = readcol(&str); cookie->name = readcol(&str);
if (!*str) if (!*str)
return; break;
cookie->value = readcol(&str); cookie->value = readcol(&str);
if (!*str) if (!*str)
return; break;
cookie->expires = (time_t) atol(readcol(&str)->ptr); cookie->expires = (time_t) atol(readcol(&str)->ptr);
if (!*str) if (!*str)
return; break;
cookie->domain = readcol(&str); cookie->domain = readcol(&str);
if (!*str) if (!*str)
return; break;
cookie->path = readcol(&str); cookie->path = readcol(&str);
if (!*str) if (!*str)
return; break;
cookie->flag = atoi(readcol(&str)->ptr); cookie->flag = atoi(readcol(&str)->ptr);
if (!*str) if (!*str)
return; break;
cookie->version = atoi(readcol(&str)->ptr); cookie->version = atoi(readcol(&str)->ptr);
if (!*str) if (!*str)
return; break;
cookie->comment = readcol(&str); cookie->comment = readcol(&str);
if (cookie->comment->length == 0) if (cookie->comment->length == 0)
cookie->comment = NULL; cookie->comment = NULL;
if (!*str) if (!*str)
return; break;
cookie->portl = make_portlist(readcol(&str)); cookie->portl = make_portlist(readcol(&str));
if (!*str) if (!*str)
return; break;
cookie->commentURL = readcol(&str); cookie->commentURL = readcol(&str);
if (cookie->commentURL->length == 0) if (cookie->commentURL->length == 0)
cookie->commentURL = NULL; cookie->commentURL = NULL;
+3 -3
View File
@@ -1228,6 +1228,7 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
unsigned char md5[MD5_DIGEST_LENGTH + 1]; unsigned char md5[MD5_DIGEST_LENGTH + 1];
Str uri = HTTPrequestURI(pu, hr); Str uri = HTTPrequestURI(pu, hr);
char nc[] = "00000001"; char nc[] = "00000001";
FILE *fp;
Str algorithm = qstr_unquote(get_auth_param(ha->param, "algorithm")); Str algorithm = qstr_unquote(get_auth_param(ha->param, "algorithm"));
Str nonce = qstr_unquote(get_auth_param(ha->param, "nonce")); Str nonce = qstr_unquote(get_auth_param(ha->param, "nonce"));
@@ -1310,10 +1311,11 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
/* A2 = Method ":" digest-uri-value ":" H(entity-body) */ /* A2 = Method ":" digest-uri-value ":" H(entity-body) */
if (request && request->body) { if (request && request->body) {
if (request->method == FORM_METHOD_POST && request->enctype == FORM_ENCTYPE_MULTIPART) { if (request->method == FORM_METHOD_POST && request->enctype == FORM_ENCTYPE_MULTIPART) {
FILE *fp = fopen(request->body, "r"); fp = fopen(request->body, "r");
if (fp != NULL) { if (fp != NULL) {
Str ebody; Str ebody;
ebody = Strfgetall(fp); ebody = Strfgetall(fp);
fclose(fp);
MD5(ebody->ptr, strlen(ebody->ptr), md5); MD5(ebody->ptr, strlen(ebody->ptr), md5);
} }
else { else {
@@ -7206,7 +7208,6 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)
HTMLlineproc0(lineBuf2->ptr, &htmlenv1, internal); HTMLlineproc0(lineBuf2->ptr, &htmlenv1, internal);
} }
if (obuf.status != R_ST_NORMAL) { if (obuf.status != R_ST_NORMAL) {
obuf.status = R_ST_EOL;
HTMLlineproc0("\n", &htmlenv1, internal); HTMLlineproc0("\n", &htmlenv1, internal);
} }
obuf.status = R_ST_NORMAL; obuf.status = R_ST_NORMAL;
@@ -7403,7 +7404,6 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf)
if (newBuf == NULL) if (newBuf == NULL)
newBuf = newBuffer(INIT_BUFFER_WIDTH); newBuf = newBuffer(INIT_BUFFER_WIDTH);
lineBuf2 = Strnew();
if (SETJMP(AbortLoading) != 0) { if (SETJMP(AbortLoading) != 0) {
goto _end; goto _end;
+3 -1
View File
@@ -895,8 +895,10 @@ renderFrame(Buffer *Cbuf, int force_reload)
/* /*
* if (Cbuf->frameQ != NULL) fset = Cbuf->frameQ->frameset; else */ * if (Cbuf->frameQ != NULL) fset = Cbuf->frameQ->frameset; else */
fset = Cbuf->frameset; fset = Cbuf->frameset;
if (fset == NULL || createFrameFile(fset, f, Cbuf, 0, force_reload) < 0) if (fset == NULL || createFrameFile(fset, f, Cbuf, 0, force_reload) < 0) {
fclose(f);
return NULL; return NULL;
}
fclose(f); fclose(f);
flag = RG_FRAME; flag = RG_FRAME;
if ((Cbuf->currentURL).is_nocache) if ((Cbuf->currentURL).is_nocache)
+6 -2
View File
@@ -123,6 +123,7 @@ static int
ftp_login(FTP ftp) ftp_login(FTP ftp)
{ {
int sock, status; int sock, status;
int sock_wf;
sock = openSocket(ftp->host, "ftp", 21); sock = openSocket(ftp->host, "ftp", 21);
if (sock < 0) if (sock < 0)
@@ -139,7 +140,6 @@ ftp_login(FTP ftp)
socklen_t socknamelen = sizeof(sockname); socklen_t socknamelen = sizeof(sockname);
if (!getsockname(sock, (struct sockaddr *)&sockname, &socknamelen)) { if (!getsockname(sock, (struct sockaddr *)&sockname, &socknamelen)) {
struct hostent *sockent;
Str tmp = Strnew_charp(ftp->pass); Str tmp = Strnew_charp(ftp->pass);
#ifdef INET6 #ifdef INET6
char hostbuf[NI_MAXHOST]; char hostbuf[NI_MAXHOST];
@@ -156,6 +156,7 @@ ftp_login(FTP ftp)
Strcat_charp(tmp, "unknown"); Strcat_charp(tmp, "unknown");
#else #else
struct hostent *sockent;
if ((sockent = gethostbyaddr((char *)&sockname.sin_addr, if ((sockent = gethostbyaddr((char *)&sockname.sin_addr,
sizeof(sockname.sin_addr), sizeof(sockname.sin_addr),
sockname.sin_family))) sockname.sin_family)))
@@ -169,7 +170,10 @@ ftp_login(FTP ftp)
} }
} }
ftp->rf = newInputStream(sock); ftp->rf = newInputStream(sock);
ftp->wf = fdopen(dup(sock), "wb"); if ((sock_wf = dup(sock)) >= 0 )
ftp->wf = fdopen(sock_wf, "wb");
else
goto open_err;
if (!ftp->rf || !ftp->wf) if (!ftp->rf || !ftp->wf)
goto open_err; goto open_err;
IStype(ftp->rf) |= IST_UNCLOSE; IStype(ftp->rf) |= IST_UNCLOSE;
+6 -1
View File
@@ -60,6 +60,7 @@ saveHistory(Hist *hist, size_t size)
FILE *f; FILE *f;
HistItem *item; HistItem *item;
char *tmpf; char *tmpf;
int rename_ret;
if (hist == NULL || hist->list == NULL) if (hist == NULL || hist->list == NULL)
return; return;
@@ -79,7 +80,11 @@ saveHistory(Hist *hist, size_t size)
disp_err_message("Can't save history", FALSE); disp_err_message("Can't save history", FALSE);
return; return;
} }
rename(tmpf, rcFile(HISTORY_FILE)); rename_ret = rename(tmpf, rcFile(HISTORY_FILE));
if (rename_ret != 0) {
disp_err_message("Can't save history", FALSE);
return;
}
} }
#endif /* USE_HISTORY */ #endif /* USE_HISTORY */
+1 -1
View File
@@ -12,7 +12,7 @@
#define StrmyUFgets(f) StrmyISgets((f)->stream) #define StrmyUFgets(f) StrmyISgets((f)->stream)
#define UFgetc(f) ISgetc((f)->stream) #define UFgetc(f) ISgetc((f)->stream)
#define UFundogetc(f) ISundogetc((f)->stream) #define UFundogetc(f) ISundogetc((f)->stream)
#define UFclose(f) (void)(ISclose((f)->stream) == 0 && ((f)->stream = NULL)) #define UFclose(f) if (ISclose((f)->stream) == 0) {(f)->stream = NULL ;}
#define UFfileno(f) ISfileno((f)->stream) #define UFfileno(f) ISfileno((f)->stream)
struct cmdtable { struct cmdtable {
-2
View File
@@ -475,8 +475,6 @@ ssl_check_cert_ident(X509 * x, char *hostname)
/* FIXME: gettextize? */ /* FIXME: gettextize? */
ret = Sprintf("Bad cert ident %s from %s", buf, hostname); ret = Sprintf("Bad cert ident %s from %s", buf, hostname);
} }
else
match_ident = TRUE;
} }
return ret; return ret;
} }
+1 -1
View File
@@ -463,7 +463,7 @@ wc_push_to_iso2022(Str os, wc_wchar_t cc, wc_status *st)
cc.code = (wc_uint32)WC_REPLACE[0]; cc.code = (wc_uint32)WC_REPLACE[0];
break; break;
default: default:
if ((cc.ccs == WC_CCS_JOHAB || WC_CCS_JOHAB_1 || if ((cc.ccs == WC_CCS_JOHAB || cc.ccs == WC_CCS_JOHAB_1 ||
cc.ccs == WC_CCS_JOHAB_2 || cc.ccs == WC_CCS_JOHAB_3) && cc.ccs == WC_CCS_JOHAB_2 || cc.ccs == WC_CCS_JOHAB_3) &&
cs94w_gmap[WC_F_KS_X_1001 - WC_F_ISO_BASE]) { cs94w_gmap[WC_F_KS_X_1001 - WC_F_ISO_BASE]) {
wc_wchar_t cc2 = wc_johab_to_ksx1001(cc); wc_wchar_t cc2 = wc_johab_to_ksx1001(cc);
+6 -4
View File
@@ -714,7 +714,8 @@ _rdcompl(void)
static void static void
next_dcompl(int next) next_dcompl(int next)
{ {
static int col, row, len; static int col, row;
static unsigned int len;
static Str d; static Str d;
int i, j, n, y; int i, j, n, y;
Str f; Str f;
@@ -780,9 +781,10 @@ next_dcompl(int next)
if (len < n) if (len < n)
len = n; len = n;
} }
col = COLS / len; if (len > 0 && COLS > len)
if (col == 0) col = COLS / len;
col = 1; else
col = 1;
row = (NCFileBuf + col - 1) / col; row = (NCFileBuf + col - 1) / col;
disp_next: disp_next:
+1 -2
View File
@@ -168,7 +168,7 @@ loadLocalDir(char *dname)
else { else {
#if defined(HAVE_LSTAT) && defined(HAVE_READLINK) #if defined(HAVE_LSTAT) && defined(HAVE_READLINK)
if (S_ISLNK(lst.st_mode)) { if (S_ISLNK(lst.st_mode)) {
if ((l = readlink(fbuf->ptr, lbuf, sizeof(lbuf))) > 0) { if ((l = readlink(fbuf->ptr, lbuf, sizeof(lbuf) - 1)) > 0) {
lbuf[l] = '\0'; lbuf[l] = '\0';
Strcat_m_charp(tmp, " -> ", Strcat_m_charp(tmp, " -> ",
html_quote(conv_from_system(lbuf)), NULL); html_quote(conv_from_system(lbuf)), NULL);
@@ -433,6 +433,5 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
fprintf(stderr, "execl(\"%s\", \"%s\", NULL): %s\n", fprintf(stderr, "execl(\"%s\", \"%s\", NULL): %s\n",
file, cgi_basename, strerror(errno)); file, cgi_basename, strerror(errno));
exit(1); exit(1);
return NULL;
#endif #endif
} }
+1 -1
View File
@@ -72,7 +72,7 @@ searchMailcap(struct mailcap *table, char *type)
} }
static int static int
matchMailcapAttr(char *p, char *attr, int len, Str *value) matchMailcapAttr(char *p, char *attr, size_t len, Str *value)
{ {
int quoted; int quoted;
char *q = NULL; char *q = NULL;
+3 -9
View File
@@ -1,6 +1,7 @@
/* $Id: main.c,v 1.270 2010/08/24 10:11:51 htrb Exp $ */ /* $Id: main.c,v 1.270 2010/08/24 10:11:51 htrb Exp $ */
#define MAINPROGRAM #define MAINPROGRAM
#include "fm.h" #include "fm.h"
#include <stdio.h>
#include <signal.h> #include <signal.h>
#include <setjmp.h> #include <setjmp.h>
#include <sys/stat.h> #include <sys/stat.h>
@@ -1266,13 +1267,13 @@ static void
dump_source(Buffer *buf) dump_source(Buffer *buf)
{ {
FILE *f; FILE *f;
char c; int c;
if (buf->sourcefile == NULL) if (buf->sourcefile == NULL)
return; return;
f = fopen(buf->sourcefile, "r"); f = fopen(buf->sourcefile, "r");
if (f == NULL) if (f == NULL)
return; return;
while (c = fgetc(f), !feof(f)) { while ((c = fgetc(f)) != EOF) {
putchar(c); putchar(c);
} }
fclose(f); fclose(f);
@@ -3071,7 +3072,6 @@ handleMailto(char *url)
/* follow HREF link */ /* follow HREF link */
DEFUN(followA, GOTO_LINK, "Go to current link") DEFUN(followA, GOTO_LINK, "Go to current link")
{ {
Line *l;
Anchor *a; Anchor *a;
ParsedURL u; ParsedURL u;
#ifdef USE_IMAGE #ifdef USE_IMAGE
@@ -3081,7 +3081,6 @@ DEFUN(followA, GOTO_LINK, "Go to current link")
if (Currentbuf->firstLine == NULL) if (Currentbuf->firstLine == NULL)
return; return;
l = Currentbuf->currentLine;
#ifdef USE_IMAGE #ifdef USE_IMAGE
a = retrieveCurrentImg(Currentbuf); a = retrieveCurrentImg(Currentbuf);
@@ -3163,13 +3162,11 @@ bufferA(void)
/* view inline image */ /* view inline image */
DEFUN(followI, VIEW_IMAGE, "View image") DEFUN(followI, VIEW_IMAGE, "View image")
{ {
Line *l;
Anchor *a; Anchor *a;
Buffer *buf; Buffer *buf;
if (Currentbuf->firstLine == NULL) if (Currentbuf->firstLine == NULL)
return; return;
l = Currentbuf->currentLine;
a = retrieveCurrentImg(Currentbuf); a = retrieveCurrentImg(Currentbuf);
if (a == NULL) if (a == NULL)
@@ -3419,7 +3416,6 @@ followForm(void)
static void static void
_followForm(int submit) _followForm(int submit)
{ {
Line *l;
Anchor *a, *a2; Anchor *a, *a2;
char *p; char *p;
FormItemList *fi, *f2; FormItemList *fi, *f2;
@@ -3428,7 +3424,6 @@ _followForm(int submit)
if (Currentbuf->firstLine == NULL) if (Currentbuf->firstLine == NULL)
return; return;
l = Currentbuf->currentLine;
a = retrieveCurrentForm(Currentbuf); a = retrieveCurrentForm(Currentbuf);
if (a == NULL) if (a == NULL)
@@ -3533,7 +3528,6 @@ _followForm(int submit)
case FORM_INPUT_BUTTON: case FORM_INPUT_BUTTON:
do_submit: do_submit:
tmp = Strnew(); tmp = Strnew();
tmp2 = Strnew();
multipart = (fi->parent->method == FORM_METHOD_POST && multipart = (fi->parent->method == FORM_METHOD_POST &&
fi->parent->enctype == FORM_ENCTYPE_MULTIPART); fi->parent->enctype == FORM_ENCTYPE_MULTIPART);
query_from_followform(&tmp, fi, multipart); query_from_followform(&tmp, fi, multipart);
-1
View File
@@ -361,7 +361,6 @@ geom_menu(Menu *menu, int x, int y, int mselect)
if (win_w > COLS) { if (win_w > COLS) {
menu->width = COLS - 2 * FRAME_WIDTH; menu->width = COLS - 2 * FRAME_WIDTH;
menu->width -= menu->width % FRAME_WIDTH; menu->width -= menu->width % FRAME_WIDTH;
win_w = menu->width + 2 * FRAME_WIDTH;
} }
} }
menu->x = win_x + FRAME_WIDTH; menu->x = win_x + FRAME_WIDTH;
+4 -2
View File
@@ -76,13 +76,15 @@ news_close(News * news)
static int static int
news_open(News * news) news_open(News * news)
{ {
int sock, status; int sock, status, fd;
sock = openSocket(news->host, "nntp", news->port); sock = openSocket(news->host, "nntp", news->port);
if (sock < 0) if (sock < 0)
goto open_err; goto open_err;
news->rf = newInputStream(sock); news->rf = newInputStream(sock);
news->wf = fdopen(dup(sock), "wb"); if ((fd = dup(sock)) < 0)
goto open_err;
news->wf = fdopen(fd, "wb");
if (!news->rf || !news->wf) if (!news->rf || !news->wf)
goto open_err; goto open_err;
IStype(news->rf) |= IST_UNCLOSE; IStype(news->rf) |= IST_UNCLOSE;
+1 -1
View File
@@ -779,7 +779,7 @@ create_option_search_table()
qsort(RC_search_table, RC_table_size, sizeof(struct rc_search_table), qsort(RC_search_table, RC_table_size, sizeof(struct rc_search_table),
(int (*)(const void *, const void *))compare_table); (int (*)(const void *, const void *))compare_table);
diff1 = diff2 = 0; diff2 = 0;
for (i = 0; i < RC_table_size - 1; i++) { for (i = 0; i < RC_table_size - 1; i++) {
p = RC_search_table[i].param->name; p = RC_search_table[i].param->name;
q = RC_search_table[i + 1].param->name; q = RC_search_table[i + 1].param->name;
+1 -3
View File
@@ -429,7 +429,6 @@ visible_length(char *str)
char *t, *r2; char *t, *r2;
int amp_len = 0; int amp_len = 0;
t = str;
while (*str) { while (*str) {
prev_status = status; prev_status = status;
if (next_status(*str, &status)) { if (next_status(*str, &status)) {
@@ -1691,7 +1690,7 @@ renderTable(struct table *t, int max_width, struct html_feed_environ *h_env)
{ {
int i, j, w, r, h; int i, j, w, r, h;
Str renderbuf; Str renderbuf;
short new_tabwidth[MAXCOL]; short new_tabwidth[MAXCOL] = { 0 };
#ifdef MATRIX #ifdef MATRIX
int itr; int itr;
VEC *newwidth; VEC *newwidth;
@@ -3018,7 +3017,6 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
break; break;
case HTML_TABLE_ALT: case HTML_TABLE_ALT:
id = -1; id = -1;
w = 0;
parsedtag_get_value(tag, ATTR_TID, &id); parsedtag_get_value(tag, ATTR_TID, &id);
if (id >= 0 && id < tbl->ntable) { if (id >= 0 && id < tbl->ntable) {
struct table *tbl1 = tbl->tables[id].ptr; struct table *tbl1 = tbl->tables[id].ptr;
-2
View File
@@ -1214,7 +1214,6 @@ addch(char pc)
{ {
l_prop *pr; l_prop *pr;
int dest, i; int dest, i;
short *dirty;
#ifdef USE_M17N #ifdef USE_M17N
static Str tmp = NULL; static Str tmp = NULL;
char **p; char **p;
@@ -1236,7 +1235,6 @@ addch(char pc)
return; return;
p = ScreenImage[CurLine]->lineimage; p = ScreenImage[CurLine]->lineimage;
pr = ScreenImage[CurLine]->lineprop; pr = ScreenImage[CurLine]->lineprop;
dirty = &ScreenImage[CurLine]->isdirty;
#ifndef USE_M17N #ifndef USE_M17N
/* Eliminate unprintables according to * iso-8859-*. /* Eliminate unprintables according to * iso-8859-*.
+2 -4
View File
@@ -819,7 +819,7 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
/* scheme://user:pass@... */ /* scheme://user:pass@... */
p_url->user = copyPath(qq, q - 1 - qq, COPYPATH_SPC_IGNORE); p_url->user = copyPath(qq, q - 1 - qq, COPYPATH_SPC_IGNORE);
p_url->pass = copyPath(q, p - q, COPYPATH_SPC_ALLOW); p_url->pass = copyPath(q, p - q, COPYPATH_SPC_ALLOW);
q = ++p; p++;
goto analyze_url; goto analyze_url;
} }
/* scheme://host:port/ */ /* scheme://host:port/ */
@@ -832,7 +832,7 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
case '@': case '@':
/* scheme://user@... */ /* scheme://user@... */
p_url->user = copyPath(q, p - q, COPYPATH_SPC_IGNORE); p_url->user = copyPath(q, p - q, COPYPATH_SPC_IGNORE);
q = ++p; p++;
goto analyze_url; goto analyze_url;
case '\0': case '\0':
/* scheme://host */ /* scheme://host */
@@ -1419,7 +1419,6 @@ HTTPrequest(ParsedURL *pu, ParsedURL *current, HRequest *hr, TextList *extra)
{ {
Str tmp; Str tmp;
TextListItem *i; TextListItem *i;
int seen_www_auth = 0;
#ifdef USE_COOKIE #ifdef USE_COOKIE
Str cookie; Str cookie;
#endif /* USE_COOKIE */ #endif /* USE_COOKIE */
@@ -1435,7 +1434,6 @@ HTTPrequest(ParsedURL *pu, ParsedURL *current, HRequest *hr, TextList *extra)
for (i = extra->first; i != NULL; i = i->next) { for (i = extra->first; i != NULL; i = i->next) {
if (strncasecmp(i->ptr, "Authorization:", if (strncasecmp(i->ptr, "Authorization:",
sizeof("Authorization:") - 1) == 0) { sizeof("Authorization:") - 1) == 0) {
seen_www_auth = 1;
#ifdef USE_SSL #ifdef USE_SSL
if (hr->command == HR_COMMAND_CONNECT) if (hr->command == HR_COMMAND_CONNECT)
continue; continue;
+5 -1
View File
@@ -79,6 +79,7 @@ print_bookmark_panel(char *bmark, char *url, char *title, char *charset)
} }
} }
printf("</select>\n"); printf("</select>\n");
fclose(f);
} }
printf(bkmark_src2, html_quote(url), html_quote(title)); printf(bkmark_src2, html_quote(url), html_quote(title));
} }
@@ -168,7 +169,10 @@ insert_bookmark(char *bmark, struct parsed_tagarg *data)
/* In this case, a new bookmark is appeneded after the bookmark file */ /* In this case, a new bookmark is appeneded after the bookmark file */
return create_new_bookmark(bmark, section, title, url, "a"); return create_new_bookmark(bmark, section, title, url, "a");
} }
f = fopen(bmark, "w"); if ((f = fopen(bmark, "w")) == NULL) {
printf("\nCannot open bookmark %s\n", bmark);
return FALSE;
}
while (tl->nitem) { while (tl->nitem) {
fputs(popText(tl), f); fputs(popText(tl), f);
} }
+1
View File
@@ -115,6 +115,7 @@ printMailcapPanel(char *mailcap)
printf("</table>\n<input type=submit name=submit value=\"%s\">\n</form>\n\ printf("</table>\n<input type=submit name=submit value=\"%s\">\n</form>\n\
</body>\n</html>\n", </body>\n</html>\n",
MSG_DOIT); MSG_DOIT);
fclose(f);
} }
void void