]> git.openstreetmap.org Git - rails.git/blobdiff - lib/gpx.rb
Ignore GPX archive entries that aren't regular files
[rails.git] / lib / gpx.rb
index d0607233a2d7f4f108ce35f0b86122c71956a0c3..86cf2f49dab377fcaccde84920866430af8ffbc2 100644 (file)
@@ -44,8 +44,8 @@ module GPX
       @tracksegs = 0
 
       begin
-        Archive::Reader.open_filename(@file).each_entry_with_data do |_entry, data|
-          parse_file(XML::Reader.string(data), &block)
+        Archive::Reader.open_filename(@file).each_entry_with_data do |entry, data|
+          parse_file(XML::Reader.string(data), &block) if entry.regular?
         end
       rescue Archive::Error
         io = ::File.open(@file)