diff options
Diffstat (limited to 'z03.c')
-rw-r--r-- | z03.c | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -1,7 +1,7 @@ /*@z03.c:File Service:Declarations, no_fpos@******************************** */ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.39) */ -/* COPYRIGHT (C) 1991, 2008 Jeffrey H. Kingston */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.41) */ +/* COPYRIGHT (C) 1991, 2023 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@it.usyd.edu.au) */ /* School of Information Technologies */ @@ -31,6 +31,7 @@ /* */ /*****************************************************************************/ #include "externs.h" +#include "child.h" #if USE_STAT #include <sys/types.h> #include <sys/stat.h> @@ -843,7 +844,7 @@ static char *compress_suffixes[MAX_COMPRESSED] FILE *OpenIncGraphicFile(FULL_CHAR *str, unsigned char typ, OBJECT *full_name, FILE_POS *xfpos, BOOLEAN *compressed) -{ FILE *fp; int p, i; BOOLEAN used_source_suffix; +{ FILE *fp; int p, i, res; BOOLEAN used_source_suffix; debug2(DFS, DD, "OpenIncGraphicFile(%s, %s, -)", str, Image(typ)); assert( typ == INCGRAPHIC || typ == SINCGRAPHIC, "OpenIncGraphicFile!" ); p = (typ == INCGRAPHIC ? INCLUDE_PATH : SYSINCLUDE_PATH); @@ -870,15 +871,23 @@ OBJECT *full_name, FILE_POS *xfpos, BOOLEAN *compressed) sprintf(buff, UNCOMPRESS_COM, (char *) string(*full_name), LOUT_EPS); if( SafeExecution ) { - Error(3, 17, "safe execution prohibiting command: %s", WARN, xfpos,buff); + Error(3, 17, "safe execution prohibiting command: %s", WARN,xfpos,buff); *compressed = FALSE; fp = null; } else { - system(buff); - fp = fopen(LOUT_EPS, READ_FILE); - *compressed = TRUE; + res = system(buff); + if( res != -1 ) /* junk code to keep the compiler happy */ + { + fp = fopen(LOUT_EPS, READ_FILE); + *compressed = TRUE; + } + else + { + *compressed = FALSE; + fp = null; + } } } else *compressed = FALSE; |