From 6a2579bb264742a07cdbbd52c21cb6d74324ddef Mon Sep 17 00:00:00 2001 From: Ito Hiroyuki Date: Sun, 18 Jul 2010 14:10:09 +0000 Subject: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=242599#21 * file.c (is_html_type): added. (examineFile, loadGeneralFile, _saveBuffer) (openGeneralPagerBuffer, reloadBuffer): use is_html_type() instead of strcasecmp(). (loadGeneralFile): set f.guess_tupe * display.c (displayBuffer): use is_html_type() instead of strcasecmp(). * buffer.c (reshapeBuffer): use is_html_type() instead of strcasecmp(). * backend.c (internal_get): use is_html_type() instead of strcasecmp(). --- main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 361dc20..ceaff34 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.259 2007/06/04 13:21:10 inu Exp $ */ +/* $Id: main.c,v 1.260 2010/07/18 14:10:09 htrb Exp $ */ #define MAINPROGRAM #include "fm.h" #include @@ -4616,10 +4616,10 @@ DEFUN(vwSrc, SOURCE VIEW, "View HTML source") buf = newBuffer(INIT_BUFFER_WIDTH); - if (!strcasecmp(Currentbuf->type, "text/html")) { + if (is_html_type(Currentbuf->type)) { buf->type = "text/plain"; if (Currentbuf->real_type && - !strcasecmp(Currentbuf->real_type, "text/html")) + is_html_type(Currentbuf->real_type)) buf->real_type = "text/plain"; else buf->real_type = Currentbuf->real_type; @@ -4769,8 +4769,8 @@ DEFUN(reload, RELOAD, "Reload buffer") repBuffer(Currentbuf, buf); if ((buf->type != NULL) && (sbuf.type != NULL) && ((!strcasecmp(buf->type, "text/plain") && - !strcasecmp(sbuf.type, "text/html")) || - (!strcasecmp(buf->type, "text/html") && + is_html_type(sbuf.type)) || + (is_html_type(buf->type) && !strcasecmp(sbuf.type, "text/plain")))) { vwSrc(); if (Currentbuf != buf) @@ -5092,7 +5092,7 @@ DEFUN(dispI, DISPLAY_IMAGE, "Restart loading and drawing of images") return; displayImage = TRUE; /* - * if (!(Currentbuf->type && !strcmp(Currentbuf->type, "text/html"))) + * if (!(Currentbuf->type && is_html_type(Currentbuf->type))) * return; */ Currentbuf->image_flag = IMG_FLAG_AUTO; @@ -5105,7 +5105,7 @@ DEFUN(stopI, STOP_IMAGE, "Stop loading and drawing of images") if (!activeImage) return; /* - * if (!(Currentbuf->type && !strcmp(Currentbuf->type, "text/html"))) + * if (!(Currentbuf->type && is_html_type(Currentbuf->type))) * return; */ Currentbuf->image_flag = IMG_FLAG_SKIP; -- cgit v1.2.3