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:
axel 2005-12-16 22:54:37 +10:00
parent a91bf6d88a
commit e6bd3dbc40

View file

@ -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 );