mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00:00
If PATH is unset, use a default value
darcs-hash:20060420183502-ac50b-8e746ae4ed00c354712cf61e57e0a187aa40a4fa.gz
This commit is contained in:
parent
c755bd0358
commit
f59e4a88c6
1 changed files with 96 additions and 86 deletions
16
parser.c
16
parser.c
|
@ -194,7 +194,7 @@ The fish parser. Contains functions for parsing code.
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
function definition block description
|
Function definition block description
|
||||||
*/
|
*/
|
||||||
#define FUNCTION_DEF_BLOCK _( L"function definition block" )
|
#define FUNCTION_DEF_BLOCK _( L"function definition block" )
|
||||||
|
|
||||||
|
@ -724,8 +724,18 @@ wchar_t *get_filename( const wchar_t *cmd )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
path = env_get(L"PATH");
|
path = env_get(L"PATH");
|
||||||
if( path != 0 )
|
if( path == 0 )
|
||||||
{
|
{
|
||||||
|
if( contains_str( PREFIX L"/bin", L"/bin", L"/usr/bin", (void *)0 ) )
|
||||||
|
{
|
||||||
|
path = L"/bin" ARRAY_SEP_STR L"/usr/bin";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
path = L"/bin" ARRAY_SEP_STR L"/usr/bin" ARRAY_SEP_STR PREFIX L"/bin";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Allocate string long enough to hold the whole command
|
Allocate string long enough to hold the whole command
|
||||||
*/
|
*/
|
||||||
|
@ -792,7 +802,7 @@ wchar_t *get_filename( const wchar_t *cmd )
|
||||||
}
|
}
|
||||||
free( path_cpy );
|
free( path_cpy );
|
||||||
free( new_cmd );
|
free( new_cmd );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue