mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Sorry, commit miss of r30412.
* re.c (rb_reg_expr_str): need to escape if the coderage is invalid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									89f9c4144f
								
							
						
					
					
						commit
						183bbd8b69
					
				
					 2 changed files with 8 additions and 3 deletions
				
			
		|  | @ -1,3 +1,7 @@ | |||
| Wed Dec 29 18:23:46 2010  NAKAMURA Usaku  <usa@ruby-lang.org> | ||||
| 
 | ||||
| 	* re.c (rb_reg_expr_str): need to escape if the coderage is invalid. | ||||
| 
 | ||||
| Wed Dec 29 10:06:51 2010  Tanaka Akira  <akr@fsij.org> | ||||
| 
 | ||||
| 	* signal.c: parenthesize macro arguments. | ||||
|  | @ -12,8 +16,6 @@ Wed Dec 29 07:07:06 2010  Eric Hodel  <drbrain@segment7.net> | |||
| 
 | ||||
| Tue Dec 28 18:36:38 2010  NAKAMURA Usaku  <usa@ruby-lang.org> | ||||
| 
 | ||||
| 	* re.c (rb_reg_expr_str): need to escape if the coderage is invalid. | ||||
| 
 | ||||
| 	* error.c, include/ruby/intern.h (rb_compile_error_with_enc): new | ||||
| 	  function to raise syntax error, with source encoding'ed message. | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										5
									
								
								re.c
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								re.c
									
										
									
									
									
								
							|  | @ -321,11 +321,14 @@ rb_reg_expr_str(VALUE str, const char *s, long len, | |||
| 	rb_encoding *enc, rb_encoding *resenc) | ||||
| { | ||||
|     const char *p, *pend; | ||||
|     int cr = ENC_CODERANGE_UNKNOWN; | ||||
|     int need_escape = 0; | ||||
|     int c, clen; | ||||
| 
 | ||||
|     p = s; pend = p + len; | ||||
|     if (rb_enc_asciicompat(enc)) { | ||||
|     rb_str_coderange_scan_restartable(p, pend, enc, &cr); | ||||
|     if (rb_enc_asciicompat(enc) && | ||||
| 	(cr == ENC_CODERANGE_VALID || cr == ENC_CODERANGE_7BIT)) { | ||||
| 	while (p < pend) { | ||||
| 	    c = rb_enc_ascget(p, pend, &clen, enc); | ||||
| 	    if (c == -1) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 usa
						usa