On Thu, Aug 17, 2017 at 12:01 PM, Athira Rajeev <atraj...@linux.vnet.ibm.com> wrote: > Adding patch which has the following change similar to telnet which: > - Assigns from getenv("USER") only if G.autologin is NULL > > Signed-off-by: Athira Rajeev <atraj...@linux.vnet.ibm.com> > > diff --git a/networking/telnet.c b/networking/telnet.c > index e1c2595..d1b79a0 100644 > --- a/networking/telnet.c > +++ b/networking/telnet.c > @@ -644,7 +644,8 @@ int telnet_main(int argc UNUSED_PARAM, char **argv) > > #if ENABLE_FEATURE_TELNET_AUTOLOGIN > if (1 & getopt32(argv, "al:", &G.autologin)) > - G.autologin = getenv("USER"); > + if (G.autologin == NULL) > + G.autologin = getenv("USER"); > argv += optind;
if (G.autologin == NULL), then -l was not specified. I propose to simply check for that condition: if (1 == getopt32(argv, "al:", &G.autologin)) /* -a without -l USER */ and not add more conditionals. Can you test that this works for you? _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox