summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/web2c/web2c/ChangeLog5
-rwxr-xr-xBuild/source/texk/web2c/web2c/convert8
2 files changed, 12 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/web2c/ChangeLog b/Build/source/texk/web2c/web2c/ChangeLog
index 3bf48558545..792a9f5939b 100644
--- a/Build/source/texk/web2c/web2c/ChangeLog
+++ b/Build/source/texk/web2c/web2c/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-06 Karl Berry <karl@tug.org>
+
+ * convert: remove $pascalfile if it is empty,
+ along with moving the non-empty .c output, etc.
+
2015-06-12 Peter Breitenlohner <peb@mppmu.mpg.de>
Integrate MFLua and MFLuaJIT.
diff --git a/Build/source/texk/web2c/web2c/convert b/Build/source/texk/web2c/web2c/convert
index 36c5c13c94c..0b56a9202ef 100755
--- a/Build/source/texk/web2c/web2c/convert
+++ b/Build/source/texk/web2c/web2c/convert
@@ -1,5 +1,7 @@
#!/bin/sh
# Convert WEB programs not needing special treatment to C.
+# Public domain. Originally written ca.1985 by Tom Rokicki,
+# Tim Morgan, Karl Berry, et al.
: ${srcdir=.}
@@ -105,9 +107,13 @@ eval "cat $srcdir/web2c/common.defines $more_defines $pascalfile \
# Using the above pipeline as the condition of an if does no good, since
# typical sh's use the status of the first command as the pipeline result.
# So check for an empty output file, or one with the error marker we put in.
-if test ! -s $cfile || grep @error@ $output_files >/dev/null; then
+if test ! -s "$cfile" || grep @error@ $output_files >/dev/null; then
: ${TMPDIR=/tmp}
# Don't just delete it, since it may be useful for debugging.
+ if test ! -s "$pascalfile"; then
+ echo "$0: $pascalfile empty, removing it." >&2
+ rm -f $pascalfile
+ fi
echo "$0: conversion of $pascalfile failed, moving dregs:" >&2
cmd="mv $output_files $TMPDIR"
(cd $TMPDIR && rm -f $output_files)