mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* object.c (rb_cstr_to_dbl): underscores should appear only
between digits. [ruby-dev:28891] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									91ea1529c6
								
							
						
					
					
						commit
						47eb32f564
					
				
					 2 changed files with 9 additions and 7 deletions
				
			
		|  | @ -1,3 +1,8 @@ | |||
| Wed Jun 28 23:23:48 2006  Yukihiro Matsumoto  <matz@ruby-lang.org> | ||||
| 
 | ||||
| 	* object.c (rb_cstr_to_dbl): underscores should appear only | ||||
| 	  between digits.  [ruby-dev:28891] | ||||
| 
 | ||||
| Wed Jun 28 19:04:34 2006  Tanaka Akira  <akr@m17n.org> | ||||
| 
 | ||||
| 	* test/socket/test_unix.rb: test_seqpacket_pair removed. | ||||
|  |  | |||
							
								
								
									
										11
									
								
								object.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								object.c
									
										
									
									
									
								
							|  | @ -2073,8 +2073,8 @@ rb_cstr_to_dbl(const char *p, int badcheck) | |||
| 	errno = 0; | ||||
|     } | ||||
|     if (p == end) { | ||||
|       bad: | ||||
| 	if (badcheck) { | ||||
| 	  bad: | ||||
| 	    rb_invalid_str(q, "Float()"); | ||||
| 	} | ||||
| 	return d; | ||||
|  | @ -2087,15 +2087,12 @@ rb_cstr_to_dbl(const char *p, int badcheck) | |||
| 	while (*p) { | ||||
| 	    if (*p == '_') { | ||||
| 		/* remove underscores between digits */ | ||||
| 		if (n == buf || !ISDIGIT(n[-1])) goto bad; | ||||
| 		while (*++p == '_'); | ||||
| 		if (badcheck) { | ||||
| 		    if (n == buf || !ISDIGIT(n[-1])) goto bad; | ||||
| 		    ++p; | ||||
| 		    if (!ISDIGIT(*p)) goto bad; | ||||
| 		} | ||||
| 		else { | ||||
| 		    while (*++p == '_'); | ||||
| 		    continue; | ||||
| 		} | ||||
| 		continue; | ||||
| 	    } | ||||
| 	    *n++ = *p++; | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 matz
						matz