mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Make the source builtin bail out at once if stat fails. Makes sure no illegal memory acces takes place
darcs-hash:20051216125437-ac50b-150f5404037186c5380884416b696d5869704a60.gz
This commit is contained in:
parent
a91bf6d88a
commit
e6bd3dbc40
1 changed files with 2 additions and 2 deletions
|
@ -2177,9 +2177,9 @@ static int builtin_source( wchar_t ** argv )
|
|||
if( wstat(argv[1], &buf) == -1 )
|
||||
{
|
||||
builtin_wperror( L"stat" );
|
||||
res = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if( !S_ISREG(buf.st_mode) )
|
||||
{
|
||||
sb_append2( sb_err, argv[0], L": Expected a regular file\n", (void *)0 );
|
||||
|
|
Loading…
Reference in a new issue