projects
/
ssic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38cef49
)
Write to a temporary file.
author
P. J. McDermott
<pjm@nac.net>
Sun, 22 Sep 2013 21:39:34 +0000
(17:39 -0400)
committer
P. J. McDermott
<pjm@nac.net>
Sun, 22 Sep 2013 21:42:08 +0000
(17:42 -0400)
src/ssic.pl
patch
|
blob
|
history
diff --git
a/src/ssic.pl
b/src/ssic.pl
index 5cc04efe502647737ace0cb520e4a5f0af852739..285c20fa4bdc5d2e779ec0ab59e8283fbe4536ff 100644
(file)
--- a/
src/ssic.pl
+++ b/
src/ssic.pl
@@
-127,8
+127,8
@@
sub compile
if ($output eq "-") {
$output_fh = *STDOUT;
} else {
- if (not open($output_fh, ">", $output)) {
- error(4, "%s: %s\n", $output, $!);
+ if (not open($output_fh, ">", $output
. "~"
)) {
+ error(4, "%s: %s\n", $output
. "~"
, $!);
}
}
@@
-159,6
+159,10
@@
sub compile
if ($output ne "-") {
close($output_fh);
}
+
+ if (not rename($output . "~", $output)) {
+ error(4, "%s: %s\n", $output, $!);
+ }
}
main();