diff options
author | axel <axel@liljencrantz.se> | 2005-12-16 22:54:37 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2005-12-16 22:54:37 +1000 |
commit | e6bd3dbc402a0aa5ff834fde13c4def3172aa70e (patch) | |
tree | 2a6a66aef9953ac214e9d10d0d68c68639f04ba5 /builtin.c | |
parent | a91bf6d88ace4e0fe8281b3b59dd9406d7cb01e0 (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.c | 4 |
1 files changed, 2 insertions, 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 ); |