summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog2
-rw-r--r--sponge.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 3a62905..f933dc7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ moreutils (0.63) UNRELEASED; urgency=medium
Thanks, Stig Palmquist.
* ts: Fix ts -m %.s to not output negative microseconds.
Thanks, Dima Kogan
+ * sponge: Fix bug in -a mode that doubled original content of file when
+ the temp file is located on a different filesystem.
-- Joey Hess <id@joeyh.name> Wed, 22 Aug 2018 21:00:58 -0400
diff --git a/sponge.c b/sponge.c
index 09d3971..f852ad5 100644
--- a/sponge.c
+++ b/sponge.c
@@ -372,7 +372,7 @@ int main (int argc, char **argv) {
}
else {
/* Fall back to slow copy. */
- outfile = fopen(outname, append ? "a" : "w");
+ outfile = fopen(outname, "w");
if (!outfile) {
perror("error opening output file");
exit(1);