mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	load.c: use TAG_RETURN
* load.c (rb_require_internal): use TAG_RETURN not a magic number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									22f75c300d
								
							
						
					
					
						commit
						f10eb2c363
					
				
					 1 changed files with 4 additions and 5 deletions
				
			
		
							
								
								
									
										9
									
								
								load.c
									
										
									
									
									
								
							
							
						
						
									
										9
									
								
								load.c
									
										
									
									
									
								
							|  | @ -1007,7 +1007,7 @@ rb_require_internal(VALUE fname, int safe) | |||
| 	    } | ||||
| 	    else if (!*ftptr) { | ||||
| 		rb_provide_feature(path); | ||||
| 		result = 1; | ||||
| 		result = TAG_RETURN; | ||||
| 	    } | ||||
| 	    else { | ||||
| 		switch (found) { | ||||
|  | @ -1022,7 +1022,7 @@ rb_require_internal(VALUE fname, int safe) | |||
| 		    break; | ||||
| 		} | ||||
| 		rb_provide_feature(path); | ||||
| 		result = 1; | ||||
| 		result = TAG_RETURN; | ||||
| 	    } | ||||
| 	} | ||||
|     } | ||||
|  | @ -1052,9 +1052,8 @@ ruby_require_internal(const char *fname, unsigned int len) | |||
|     struct RString fake; | ||||
|     VALUE str = rb_setup_fake_str(&fake, fname, len, 0); | ||||
|     int result = rb_require_internal(str, 0); | ||||
|     if (result > 1) result = -1; | ||||
|     rb_set_errinfo(Qnil); | ||||
|     return result; | ||||
|     return result == TAG_RETURN ? 1 : result ? -1 : 0; | ||||
| } | ||||
| 
 | ||||
| VALUE | ||||
|  | @ -1062,7 +1061,7 @@ rb_require_safe(VALUE fname, int safe) | |||
| { | ||||
|     int result = rb_require_internal(fname, safe); | ||||
| 
 | ||||
|     if (result > 1) { | ||||
|     if (result > TAG_RETURN) { | ||||
| 	JUMP_TAG(result); | ||||
|     } | ||||
|     if (result < 0) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 nobu
						nobu