aboutsummaryrefslogtreecommitdiffstats
path: root/z03.c
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-05-19 00:42:48 +0200
committerMatěj Cepl <mcepl@cepl.eu>2024-05-19 00:42:48 +0200
commiteb3942e15700f3f4f61b4e46917ae8fbe614e524 (patch)
treebe0c003fa8a0dead8d9dc921050ba13a56d1a9dd /z03.c
parent71d625f730d872791eef74d7999e1be28d5e5c7e (diff)
downloadlout-master.tar.gz
Lout 3.41.HEADmaster
http://jeffreykingston.id.au/lout/lout-3.41.tar.gz
Diffstat (limited to 'z03.c')
-rw-r--r--z03.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/z03.c b/z03.c
index c2b3df4..0d7d46f 100644
--- a/z03.c
+++ b/z03.c
@@ -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;