ffi-libarchive 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +3 -0
- data/lib/ffi-libarchive/reader.rb +3 -3
- data/lib/ffi-libarchive/writer.rb +3 -3
- data/version.txt +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -46,9 +46,9 @@ module Archive
|
|
46
46
|
raise Error, @archive if C::archive_read_open_filename(archive, params[:file_name], 1024) != C::OK
|
47
47
|
elsif params[:memory]
|
48
48
|
str = params[:memory]
|
49
|
-
@data = FFI::MemoryPointer.new(str.
|
50
|
-
@data.write_string str, str.
|
51
|
-
raise Error, @archive if C::archive_read_open_memory(archive, @data, str.
|
49
|
+
@data = FFI::MemoryPointer.new(str.bytesize + 1)
|
50
|
+
@data.write_string str, str.bytesize
|
51
|
+
raise Error, @archive if C::archive_read_open_memory(archive, @data, str.bytesize) != C::OK
|
52
52
|
end
|
53
53
|
rescue
|
54
54
|
close
|
@@ -100,7 +100,7 @@ module Archive
|
|
100
100
|
entry = Entry.new
|
101
101
|
data = yield entry
|
102
102
|
if data
|
103
|
-
entry.size = data.
|
103
|
+
entry.size = data.bytesize
|
104
104
|
write_header entry
|
105
105
|
write_data data
|
106
106
|
else
|
@@ -119,7 +119,7 @@ module Archive
|
|
119
119
|
len = 0
|
120
120
|
while true do
|
121
121
|
str = yield
|
122
|
-
if ((n = C::archive_write_data(ar, str, str.
|
122
|
+
if ((n = C::archive_write_data(ar, str, str.bytesize)) < 1)
|
123
123
|
return len
|
124
124
|
end
|
125
125
|
len += n
|
@@ -127,7 +127,7 @@ module Archive
|
|
127
127
|
else
|
128
128
|
raise ArgumentError, "wrong number of argument (#{args.size}) for 1)" if args.size != 1
|
129
129
|
str = args[0]
|
130
|
-
C::archive_write_data(archive, str, str.
|
130
|
+
C::archive_write_data(archive, str, str.bytesize)
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ffi-libarchive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Frank Fischer
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-20 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ffi
|