mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Explicitly convert int to char during transform on string (equivalent of PR #756)
This commit is contained in:
		
							
								
								
									
										5
									
								
								include/external/clara.h
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								include/external/clara.h
									
									
									
									
										vendored
									
									
								
							| @@ -396,9 +396,12 @@ namespace Clara { | ||||
|         inline void convertInto( std::string const& _source, std::string& _dest ) { | ||||
|             _dest = _source; | ||||
|         } | ||||
|         char toLowerCh(char c) { | ||||
|             return static_cast<char>( ::tolower( c ) ); | ||||
|         } | ||||
|         inline void convertInto( std::string const& _source, bool& _dest ) { | ||||
|             std::string sourceLC = _source; | ||||
|             std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower ); | ||||
|             std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), toLowerCh ); | ||||
|             if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) | ||||
|                 _dest = true; | ||||
|             else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash