mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* dir.c (bracket): get rid of scanning at the end of the pattern
string, not to raise an exception while globbing command line. [ruby-core:32478] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									c7caeda5ed
								
							
						
					
					
						commit
						89130aa8e1
					
				
					 3 changed files with 19 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,9 @@
 | 
			
		|||
Mon Sep 20 23:23:05 2010  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* dir.c (bracket): get rid of scanning at the end of the pattern
 | 
			
		||||
	  string, not to raise an exception while globbing command line.
 | 
			
		||||
	  [ruby-core:32478]
 | 
			
		||||
 | 
			
		||||
Mon Sep 20 11:25:49 2010  Tanaka Akira  <akr@fsij.org>
 | 
			
		||||
 | 
			
		||||
	* ext/pathname/pathname.c (Init_pathname): Pathname#=~ undefinition
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								dir.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								dir.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -108,6 +108,7 @@ bracket(
 | 
			
		|||
    int r;
 | 
			
		||||
    int ok = 0, not = 0;
 | 
			
		||||
 | 
			
		||||
    if (p >= pend) return NULL;
 | 
			
		||||
    if (*p == '!' || *p == '^') {
 | 
			
		||||
	not = 1;
 | 
			
		||||
	p++;
 | 
			
		||||
| 
						 | 
				
			
			@ -120,6 +121,7 @@ bracket(
 | 
			
		|||
	if (!*t1)
 | 
			
		||||
	    return NULL;
 | 
			
		||||
	p = t1 + (r = rb_enc_mbclen(t1, pend, enc));
 | 
			
		||||
	if (p >= pend) return NULL;
 | 
			
		||||
	if (p[0] == '-' && p[1] != ']') {
 | 
			
		||||
	    const char *t2 = p + 1;
 | 
			
		||||
	    int r2;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -461,4 +461,15 @@ class TestRubyOptions < Test::Unit::TestCase
 | 
			
		|||
    }
 | 
			
		||||
    assert_equal("\"zzz\\n\"\n", result, '[ruby-core:30910]')
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_unmatching_glob
 | 
			
		||||
    bug3851 = '[ruby-core:32478]'
 | 
			
		||||
    a = "a[foo"
 | 
			
		||||
    Dir.mktmpdir do |dir|
 | 
			
		||||
      open(File.join(dir, a), "w") {|f| f.puts("p 42")}
 | 
			
		||||
      assert_in_out_err(["-C", dir, a], "", ["42"], [], bug3851)
 | 
			
		||||
      File.unlink(File.join(dir, a))
 | 
			
		||||
      assert_in_out_err(["-C", dir, a], "", [], /LoadError/, bug3851)
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue