Skip to content

Commit

Permalink
Merge pull request #87 from amco/commit_required_fix
Browse files Browse the repository at this point in the history
Unset @create when zip exists, fixes #86
  • Loading branch information
simonoff committed Aug 14, 2013
2 parents b4b87a1 + 8d912fb commit f472f08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/zip/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ def initialize(fileName, create = nil, buffer = false)
super()
@name = fileName
@comment = ""
@create = create
case
when ::File.exists?(fileName) && !buffer
@create = nil
::File.open(name, "rb") do |f|
read_from_stream(f)
end
Expand All @@ -75,7 +77,6 @@ def initialize(fileName, create = nil, buffer = false)
else
raise ZipError, "File #{fileName} not found"
end
@create = create
@storedEntries = @entry_set.dup
@storedComment = @comment
@restore_ownership = false
Expand Down

0 comments on commit f472f08

Please sign in to comment.