aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-12-16 22:54:37 +1000
committerGravatar axel <axel@liljencrantz.se>2005-12-16 22:54:37 +1000
commite6bd3dbc402a0aa5ff834fde13c4def3172aa70e (patch)
tree2a6a66aef9953ac214e9d10d0d68c68639f04ba5 /builtin.c
parenta91bf6d88ace4e0fe8281b3b59dd9406d7cb01e0 (diff)
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
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index d2b37a2e..dd1a51b9 100644
--- a/builtin.c
+++ b/builtin.c
@@ -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 );