Only rename output file if it's not "-".
[ssic.git] / src / ssic.pl
index ba8b184355519a7b115f0d2db13c70f28dbe2800..81bb50dfdcdc29868805a5e6374b78d6862894a6 100755 (executable)
@@ -173,10 +173,9 @@ sub compile
        }
        if ($output ne "-") {
                close($output_fh);
-       }
-
-       if (not rename($output . "~", $output)) {
-               error(4, "%s: %s\n", $output, $!);
+               if (not rename($output . "~", $output)) {
+                       error(4, "%s: %s\n", $output, $!);
+               }
        }
 }