[PATCH] RubyGems' string contains null byte issue

  • Thread starter Mauricio Fernández
  • Start date
M

Mauricio Fernández

For those who don't have the dir.c fix:


--- loadpath_manager.rb.orig 2004-11-28 22:34:43.000000000 +0100
+++ loadpath_manager.rb 2004-11-28 22:38:19.000000000 +0100
@@ -60,13 +60,13 @@
end

def self.search_loadpath(file)
- result = Dir.glob("{#{($LOAD_PATH).join(',')}}/#{file}{,.rb,.so}").delete_if {|f| File.directory?(f)}.size > 0
+ result = Dir.glob("{#{($LOAD_PATH).join(',')}}/#{file}{,.rb,.so}").map{|x| Marshal.load(Marshal.dump(x))}.delete_if {|f| File.directory?(f)}.size > 0
result
end

def self.search_gempath(file)
build_paths unless @paths
- fullname = Dir.glob("{#{(@paths).join(',')}}/#{file}{,.rb,.so}").delete_if {|f| File.directory?(f)}.first
+ fullname = Dir.glob("{#{(@paths).join(',')}}/#{file}{,.rb,.so}").map{|x| Marshal.load(Marshal.dump(x))}.delete_if {|f| File.directory?(f)}.first
return false unless fullname
@specs.each do |spec|
if fullname.include?("/#{spec.full_name}/")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top