mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 05:59:32 +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 ) {
 | 
					        inline void convertInto( std::string const& _source, std::string& _dest ) {
 | 
				
			||||||
            _dest = _source;
 | 
					            _dest = _source;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        char toLowerCh(char c) {
 | 
				
			||||||
 | 
					            return static_cast<char>( ::tolower( c ) );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        inline void convertInto( std::string const& _source, bool& _dest ) {
 | 
					        inline void convertInto( std::string const& _source, bool& _dest ) {
 | 
				
			||||||
            std::string sourceLC = _source;
 | 
					            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" )
 | 
					            if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" )
 | 
				
			||||||
                _dest = true;
 | 
					                _dest = true;
 | 
				
			||||||
            else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" )
 | 
					            else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" )
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user