mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 13:01:21 -03:00
Redesign new environment variables to use env_var_t instead of wcstring
Migrate uses of empty() to missing() to distinguish between empty variable and unset variable
This commit is contained in:
@@ -190,23 +190,20 @@ int highlight_get_color( int highlight )
|
||||
}
|
||||
}
|
||||
|
||||
wcstring val_wstr = env_get_string( highlight_var[idx]);
|
||||
const wchar_t *val = val_wstr.empty()?NULL:val_wstr.c_str();
|
||||
env_var_t val_wstr = env_get_string( highlight_var[idx]);
|
||||
|
||||
// debug( 1, L"%d -> %d -> %ls", highlight, idx, val );
|
||||
|
||||
if( val == 0 ) {
|
||||
if (val_wstr.missing())
|
||||
val_wstr = env_get_string( highlight_var[0]);
|
||||
val = val_wstr.empty()?NULL:val_wstr.c_str();
|
||||
}
|
||||
|
||||
if( val )
|
||||
result = output_color_code( val );
|
||||
if( ! val_wstr.missing() )
|
||||
result = output_color_code( val_wstr.c_str() );
|
||||
|
||||
if( highlight & HIGHLIGHT_VALID_PATH )
|
||||
{
|
||||
wcstring val2_wstr = env_get_string( L"fish_color_valid_path" );
|
||||
const wchar_t *val2 = val2_wstr.empty()?NULL:val2_wstr.c_str();
|
||||
env_var_t val2_wstr = env_get_string( L"fish_color_valid_path" );
|
||||
const wchar_t *val2 = val2_wstr.missing() ? NULL : val2_wstr.c_str();
|
||||
|
||||
int result2 = output_color_code( val2 );
|
||||
if( result == FISH_COLOR_NORMAL )
|
||||
|
||||
Reference in New Issue
Block a user