mirror of
				https://github.com/pragma-/pbot.git
				synced 2025-11-04 00:27:23 +01:00 
			
		
		
		
	Interpreter: fix $0 in commands that use &{subs}
This commit is contained in:
		
							parent
							
								
									ca21999d5d
								
							
						
					
					
						commit
						05cf63e00c
					
				@ -368,6 +368,13 @@ sub interpret {
 | 
			
		||||
            # add it to the list of substituted commands
 | 
			
		||||
            push @{$context->{subcmd}}, "$keyword $arguments";
 | 
			
		||||
 | 
			
		||||
            # FIXME: quick-and-dirty hack to fix $0.
 | 
			
		||||
            # Without this hack `pet &{echo dog}` will output `You echo
 | 
			
		||||
            # the dog` instead of `You pet the dog`.
 | 
			
		||||
            if (not defined $context->{root_keyword}) {
 | 
			
		||||
                $context->{root_keyword} = $keyword;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            # trim surrounding whitespace
 | 
			
		||||
            $command =~ s/^\s+|\s+$//g;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -25,8 +25,8 @@ use PBot::Imports;
 | 
			
		||||
# These are set by the /misc/update_version script
 | 
			
		||||
use constant {
 | 
			
		||||
    BUILD_NAME     => "PBot",
 | 
			
		||||
    BUILD_REVISION => 4632,
 | 
			
		||||
    BUILD_DATE     => "2023-03-19",
 | 
			
		||||
    BUILD_REVISION => 4633,
 | 
			
		||||
    BUILD_DATE     => "2023-03-23",
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
sub initialize {}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user