From ebd60226a3ec3a6e0c9d4a12581d2bea83b1e293 Mon Sep 17 00:00:00 2001 From: Charles Forsyth Date: Fri, 27 Mar 2015 00:40:11 +0000 Subject: do -l as well as -c --- appl/cmd/sh/sh.b | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'appl/cmd') 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; -- cgit v1.2.3