Description: Simplify ps2ascii
Author: наб <nabijaczleweli@nabijaczleweli.xyz>
Forwarded: no
Last-Update: 2024-03-03


--- a/lib/ps2ascii
+++ b/lib/ps2ascii
@@ -9,13 +9,6 @@
 # executable name set in the makefile
 GS_EXECUTABLE=gs
 
-trap "rm -f _temp_.err _temp_.out" 0 1 2 15
+trap "rm -f _temp_.err _temp_.out" EXIT HUP INT TERM
 
-OPTIONS="-q -dSAFER -sDEVICE=txtwrite"
-if ( test $# -eq 0 ) then
-    $GS_EXECUTABLE $OPTIONS -o - -
-elif ( test $# -eq 1 ) then
-    $GS_EXECUTABLE $OPTIONS -o - "$1"
-else
-    $GS_EXECUTABLE $OPTIONS -o "$2" "$1"
-fi
+"$GS_EXECUTABLE" -q -dSAFER -sDEVICE=txtwrite -o "${2:--}" "${1:--}"
