diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi.rb | 1 | ||||
-rw-r--r-- | lib/find.rb | 6 | ||||
-rw-r--r-- | lib/mkmf.rb | 20 |
3 files changed, 24 insertions, 3 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb index 5ec7e6a7b7..5b785bab3a 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -2318,3 +2318,4 @@ class CGI end # class CGI +? diff --git a/lib/find.rb b/lib/find.rb index e94d5c2c70..52efde81fd 100644 --- a/lib/find.rb +++ b/lib/find.rb @@ -36,8 +36,8 @@ module Find paths.collect!{|d| d.dup} while file = paths.shift catch(:prune) do - yield file.dup - file.untaint + next unless File.exist? file + yield file.dup.taint begin if File.lstat(file).directory? then d = Dir.open(file) @@ -51,7 +51,7 @@ module Find else f = File.join(file, f) end - paths.unshift f + paths.unshift f.untaint end ensure d.close diff --git a/lib/mkmf.rb b/lib/mkmf.rb index f9fe4608a3..6315e1f8bf 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -538,6 +538,26 @@ def have_header(header, &b) end end +def find_header(header, *paths) + checking_for header do + if try_cpp(cpp_include(header)) + true + else + found = false + paths.each do |dir| + opt = "-I#{dir}" + if try_cpp(cpp_include(header), opt) + $INCFLAGS += " " + $INCFLAGS += opt + found = true + break + end + end + found + end + end +end + def have_struct_member(type, member, header = nil, &b) checking_for "#{type}.#{member}" do if try_compile(<<"SRC", &b) |