From 5e465bc694b0d7c28b26639f59d4cb54575d1809 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 6 Apr 2016 21:20:16 +0000 Subject: remove empty (thus invalid) .p file git-svn-id: svn://tug.org/texlive/trunk@40268 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/web2c/ChangeLog | 5 +++++ Build/source/texk/web2c/web2c/convert | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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 + + * convert: remove $pascalfile if it is empty, + along with moving the non-empty .c output, etc. + 2015-06-12 Peter Breitenlohner 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) -- cgit v1.2.3