summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Forsyth <charles.forsyth@gmail.com>2015-03-27 00:40:11 +0000
committerCharles Forsyth <charles.forsyth@gmail.com>2015-03-27 00:40:11 +0000
commitebd60226a3ec3a6e0c9d4a12581d2bea83b1e293 (patch)
tree0823dd016811d6d5ff5890f6dcacb39c86ff1c20
parenta3fc98a59cb436f3678ce072f553a8d9f024f33a (diff)
do -l as well as -c
-rw-r--r--appl/cmd/sh/sh.b9
1 files changed, 4 insertions, 5 deletions
diff --git a/appl/cmd/sh/sh.b b/appl/cmd/sh/sh.b
index 7cd69cb0..215d8bba 100644
--- a/appl/cmd/sh/sh.b
+++ b/appl/cmd/sh/sh.b
@@ -175,6 +175,10 @@ loop: while (argv != nil && hd argv != nil && (hd argv)[0] == '-') {
sys->pctl(Sys->FORKNS, nil);
ctxt := Context.new(drawcontext);
ctxt.setoptions(opts.ctxtflags, 1);
+
+ # if login shell, run standard init script
+ if (opts.lflag)
+ runscript(ctxt, LIBSHELLRC, nil, 0);
if (opts.carg != nil) {
status := ctxt.run(stringlist2list("{" + opts.carg + "}" :: argv), !interactive);
if (!interactive) {
@@ -184,11 +188,6 @@ loop: while (argv != nil && hd argv != nil && (hd argv)[0] == '-') {
}
setstatus(ctxt, status);
}
-
- # if login shell, run standard init script
- if (opts.lflag)
- runscript(ctxt, LIBSHELLRC, nil, 0);
-
if (argv == nil) {
if (isconsole(sys->fildes(0)))
interactive |= ctxt.INTERACTIVE;