mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-22 01:47:41 +08:00
Make sure the help switch to the cd command is not flagged as an error
darcs-hash:20080109030647-75c98-f82822cde746d1c8a89512481347061cfeb41e43.gz
This commit is contained in:
parent
2229fad410
commit
605fffa9d2
@ -607,11 +607,14 @@ void highlight_shell( wchar_t * buff,
|
|||||||
if( cmd && (wcscmp( cmd, L"cd" ) == 0) )
|
if( cmd && (wcscmp( cmd, L"cd" ) == 0) )
|
||||||
{
|
{
|
||||||
wchar_t *dir = expand_one( context,
|
wchar_t *dir = expand_one( context,
|
||||||
wcsdup(tok_last( &tok )),
|
wcsdup(tok_last( &tok )),
|
||||||
EXPAND_SKIP_CMDSUBST );
|
EXPAND_SKIP_CMDSUBST );
|
||||||
if( dir )
|
if( dir )
|
||||||
{
|
{
|
||||||
if( !path_get_cdpath( context, dir ) )
|
int is_long_help = wcsncmp(dir,L"--help", wcslen(dir) );
|
||||||
|
int is_short_help = wcsncmp(dir,L"-h", wcslen(dir) );
|
||||||
|
|
||||||
|
if( !is_long_help && !is_short_help && !path_get_cdpath( context, dir ) )
|
||||||
{
|
{
|
||||||
color[ tok_get_pos( &tok ) ] = HIGHLIGHT_ERROR;
|
color[ tok_get_pos( &tok ) ] = HIGHLIGHT_ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user