From c2c01b60dd063ed4728986d513b51138ccf9de4a Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Tue, 9 Apr 2002 14:45:58 +0000 Subject: [w3m-dev 03167] xface2xbm -> xface2xpm (current imlib can't handle XBM) * configure: s/XFACE2XBM/XFACE2XPM/ * config.h.dist: ditto * file.c (xface2xpm): renamed from xface2xbm modified for xpm (readHeader): s/xface2xbm/xface2xpm/ * scripts/Makefile (LIB_TARGETS): s/xface2xbm/xface2xpm/ * scripts/xface2xpm.in: added From: Hironori Sakamoto --- file.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 4fe12a6..89d96a8 100644 --- a/file.c +++ b/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.88 2002/03/19 15:54:47 ukai Exp $ */ +/* $Id: file.c,v 1.89 2002/04/09 14:45:58 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -507,22 +507,24 @@ matchattr(char *p, char *attr, int len, Str *value) #ifdef USE_IMAGE #ifdef USE_XFACE static char * -xface2xbm(char *xface) +xface2xpm(char *xface) { - char *xbm; + char *xpm; FILE *f; struct stat st; - xbm = tmpfname(TMPF_DFL, ".xbm")->ptr; - f = popen(Sprintf("%s - %s", libFile(XFACE2XBM), xbm)->ptr, "w"); + xpm = tmpfname(TMPF_DFL, ".xpm")->ptr; + f = popen(Sprintf("%s > %s", libFile(XFACE2XPM), xpm)->ptr, "w"); if (!f) return NULL; fprintf(f, "%s", xface); pclose(f); - if (stat(xbm, &st)) + if (stat(xpm, &st)) return NULL; - pushText(fileToDelete, xbm); - return xbm; + pushText(fileToDelete, xpm); + if (!st.st_size) + return NULL; + return xpm; } #endif #endif @@ -631,7 +633,7 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu) URLFile f; Line *l; - tmpf = xface2xbm(&tmp->ptr[7]); + tmpf = xface2xpm(&tmp->ptr[7]); if (tmpf) { src = Sprintf -- cgit v1.2.3