aboutsummaryrefslogtreecommitdiffstats
path: root/lib/pstore.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-06 07:40:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-06 07:40:06 +0000
commitfbb88b011aab36a5d3bed8be3098b9d4d439cee1 (patch)
treec863bbdf5807cf170ca21f3df33c9cbc847d403f /lib/pstore.rb
parent3d17082a50358d83da7f65e923b5559dd8b20ca5 (diff)
downloadruby-fbb88b011aab36a5d3bed8be3098b9d4d439cee1.tar.gz
* io.c (rb_io_mode_flags): preserve append mode flag.
[ruby-dev:24436] * io.c (rb_io_modenum_mode): do not use external output buffer. * string.c (rb_str_justify): differ pointer retrieval to prevent padding string modification. [ruby-dev:24434] * range.c (range_each_func): allow func to terminate loop by returning RANGE_EACH_BREAK. * range.c (member_i): use RANGE_EACH_BREAK. [ruby-talk:114959] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/pstore.rb')
-rw-r--r--lib/pstore.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/pstore.rb b/lib/pstore.rb
index dc4d976a4c..50313dcb8f 100644
--- a/lib/pstore.rb
+++ b/lib/pstore.rb
@@ -134,6 +134,7 @@ class PStore
content = dump(@table)
if !md5 || size != content.size || md5 != Digest::MD5.digest(content)
File.open(tmp_file, "w") {|t|
+ t.binmode
t.write(content)
}
File.rename(tmp_file, new_file)
@@ -168,6 +169,7 @@ class PStore
f.rewind
new_file = @filename + ".new"
File.open(new_file) do |nf|
+ nf.binmode
FileUtils.copy_stream(nf, f)
end
File.unlink(new_file)