diff --git a/bin/sh/options.c b/bin/sh/options.c index 54a9cb4c1c49..92857027843a 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -194,7 +194,7 @@ options(int cmdline) if (q == NULL || minusc != NULL) error("Bad -c option"); minusc = q; - } else if (c == 'l') { + } else if (c == 'l' && cmdline) { login = 1; } else if (c == 'o') { minus_o(*argptr, val);