From 756396e3b1aabfda562fd3636f1ecd6e6c605ec3 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 23 May 2012 12:50:37 -0400 Subject: [PATCH] Allow the -k flag to be used along with the -i and -s flags. --HG-- branch : 1.7 --- parse_args.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/parse_args.c b/parse_args.c index d6fa8426f..33412f978 100644 --- a/parse_args.c +++ b/parse_args.c @@ -251,13 +251,15 @@ parse_args(argc, argv) if (!mode) { /* Defer -k mode setting until we know whether it is a flag or not */ - if (ISSET(flags, MODE_INVALIDATE) && NewArgc == 0) { - mode = MODE_INVALIDATE; /* -k by itself */ - CLR(flags, MODE_INVALIDATE); - valid_flags = 0; - } else { - mode = MODE_RUN; /* running a command */ + if (ISSET(flags, MODE_INVALIDATE)) { + if (NewArgc == 0 && !(flags & (MODE_SHELL|MODE_LOGIN_SHELL))) { + mode = MODE_INVALIDATE; /* -k by itself */ + CLR(flags, MODE_INVALIDATE); + valid_flags = 0; + } } + if (!mode) + mode = MODE_RUN; /* running a command */ } if (NewArgc > 0 && mode == MODE_LIST) -- 2.40.0