From 48d11533b408ccd44b9818ebe54bc1d8cbbd3710 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Thu, 27 Dec 2001 17:43:22 +0000 Subject: [w3m-dev 02760] From: Hironori Sakamoto --- ChangeLog | 9 ++++++++- file.c | 4 +++- main.c | 8 +++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index adbb806..272bd15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-12-28 Hironori Sakamoto + + * [w3m-dev 02760] + * file.c (getshell): check buf == NULL + * main.c (execdict): check buf == NULL + buf->type == NULL, then buf->type is set as "text/plain" + 2001-12-28 Hironori Sakamoto * [w3m-dev 02759] fold textarea @@ -1711,4 +1718,4 @@ * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.189 2001/12/27 17:37:49 ukai Exp $ +$Id: ChangeLog,v 1.190 2001/12/27 17:43:22 ukai Exp $ diff --git a/file.c b/file.c index 89bd2bd..6e87e6b 100644 --- a/file.c +++ b/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.34 2001/12/25 18:15:00 ukai Exp $ */ +/* $Id: file.c,v 1.35 2001/12/27 17:43:23 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -5437,6 +5437,8 @@ getshell(char *cmd) Buffer *buf; buf = loadcmdout(cmd, loadBuffer, NULL); + if (buf == NULL) + return NULL; buf->filename = cmd; buf->buffername = Sprintf("%s %s", SHELLBUFFERNAME, conv_from_system(cmd))->ptr; diff --git a/main.c b/main.c index 5269e75..d650f1c 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.51 2001/12/27 17:23:07 ukai Exp $ */ +/* $Id: main.c,v 1.52 2001/12/27 17:43:24 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include @@ -4616,8 +4616,6 @@ execdict(char *word) prevtrap = signal(SIGINT, intTrap); crmode(); buf = getshell(myExtCommand(DICTCMD, shell_quote(w), FALSE)->ptr); - buf->filename = w; - buf->buffername = Sprintf("%s %s", DICTBUFFERNAME, word)->ptr; signal(SIGINT, prevtrap); term_raw(); if (buf == NULL) { @@ -4628,7 +4626,11 @@ execdict(char *word) disp_message(Sprintf("Word \"%s\" Not Found", word)->ptr, FALSE); } else { + buf->filename = w; + buf->buffername = Sprintf("%s %s", DICTBUFFERNAME, word)->ptr; buf->bufferprop |= (BP_INTERNAL | BP_NO_URL); + if (buf->type == NULL) + buf->type = "text/plain"; pushBuffer(buf); } displayBuffer(Currentbuf, B_FORCE_REDRAW); -- cgit v1.2.3