summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtools/shmin.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/shmin.sh b/tools/shmin.sh
index f84e31d..4c3c40b 100755
--- a/tools/shmin.sh
+++ b/tools/shmin.sh
@@ -188,7 +188,12 @@ minify()
fgetc
done
- # We made it. Now write the output.
+ # We made it. Now close input file.
+ if ! exec 3<&-; then
+ die 'Cannot close file "%s"' "${input}"
+ fi
+
+ # Write the output.
if ! printf '%s' "${buffer}" >"${output}~"; then
die 'Cannot write file "%s"' "${output}~"
fi