diff options
Diffstat (limited to 'bin/sh')
-rw-r--r-- | bin/sh/main.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bin/sh/main.c b/bin/sh/main.c index 5ad69f2..a23efd0 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -316,19 +316,21 @@ int dotcmd(int argc, char **argv) { struct strlist *sp; + char *fullname; + + if (argc < 2) + error("missing filename"); + exitstatus = 0; for (sp = cmdenviron; sp ; sp = sp->next) setvareq(savestr(sp->text), VSTRFIXED|VTEXTFIXED); - if (argc >= 2) { /* That's what SVR2 does */ - char *fullname = find_dot_file(argv[1]); - - setinputfile(fullname, 1); - commandname = fullname; - cmdloop(0); - popfile(); - } + fullname = find_dot_file(argv[1]); + setinputfile(fullname, 1); + commandname = fullname; + cmdloop(0); + popfile(); return exitstatus; } |