summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/web2c/convert
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/web2c/convert')
-rwxr-xr-xBuild/source/texk/web2c/web2c/convert8
1 files changed, 7 insertions, 1 deletions
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)