From 05af6d32e67e92f4bcc21c337acf66c7eb05a3cd Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Wed, 30 Jan 2002 15:08:48 +0000 Subject: [w3m-dev 02933] segmentation fault when w3m -dump https: * file.c (readHeader): use inputAnswer() * file.c (getAuthCookie): remove term_cbreak() * file.c (checkOverWrite): use inputAnswer() * file.c (inputAnswer): added * istream.c (ssl_get_certificate): use inputAnswer() * main.c (qquitfm): change prompt * proto.h (inputAnswer): added From: Hironori Sakamoto --- istream.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'istream.c') diff --git a/istream.c b/istream.c index 7f92b57..0239b5a 100644 --- a/istream.c +++ b/istream.c @@ -1,4 +1,4 @@ -/* $Id: istream.c,v 1.11 2002/01/12 13:33:47 ukai Exp $ */ +/* $Id: istream.c,v 1.12 2002/01/30 15:08:48 ukai Exp $ */ #include "fm.h" #include "istream.h" #include @@ -476,11 +476,10 @@ ssl_get_certificate(InputStream stream, char *hostname) && strcasecmp(accept_this_site->ptr, hostname) == 0) ans = "y"; else { - emsg = Strnew_charp("No SSL peer certificate: accept (y/n)?"); - term_raw(); - ans = inputChar(emsg->ptr); + emsg = Strnew_charp("No SSL peer certificate: accept? (y/n)"); + ans = inputAnswer(emsg->ptr); } - if (tolower(*ans) == 'y') + if (ans && tolower(*ans) == 'y') amsg = Strnew_charp ("Accept SSL session without any peer certificate"); else { @@ -510,11 +509,10 @@ ssl_get_certificate(InputStream stream, char *hostname) && strcasecmp(accept_this_site->ptr, hostname) == 0) ans = "y"; else { - emsg = Sprintf("%s: accept (y/n)?", em); - term_raw(); - ans = inputChar(emsg->ptr); + emsg = Sprintf("%s: accept? (y/n)", em); + ans = inputAnswer(emsg->ptr); } - if (tolower(*ans) == 'y') { + if (ans && tolower(*ans) == 'y') { amsg = Sprintf("Accept unsecure SSL session: " "unverified: %s", em); } @@ -537,11 +535,10 @@ ssl_get_certificate(InputStream stream, char *hostname) Str ep = Strdup(emsg); if (ep->length > COLS - 16) Strshrink(ep, ep->length - (COLS - 16)); - term_raw(); - Strcat_charp(ep, ": accept(y/n)?"); - ans = inputChar(ep->ptr); + Strcat_charp(ep, ": accept? (y/n)"); + ans = inputAnswer(ep->ptr); } - if (tolower(*ans) == 'y') { + if (ans && tolower(*ans) == 'y') { amsg = Strnew_charp("Accept unsecure SSL session:"); Strcat(amsg, emsg); } -- cgit v1.2.3