From 0b971e1c5dc702e6acba2986edb4ab70900963a2 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Tue, 11 May 1999 19:01:39 +0000 Subject: [PATCH] (main): add fallback to rlogin git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6209 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/rsh/rsh.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/appl/rsh/rsh.c b/appl/rsh/rsh.c index 8b2e36c2a..a90320a11 100644 --- a/appl/rsh/rsh.c +++ b/appl/rsh/rsh.c @@ -672,7 +672,7 @@ usage (int ret) arg_printusage (args, sizeof(args) / sizeof(args[0]), NULL, - "host command"); + "host [command]"); exit (ret); } @@ -736,14 +736,17 @@ main(int argc, char **argv) } if (host == NULL) { - if (argc - optind < 2) + if (argc - optind < 1) usage (1); else host = argv[host_index = optind++]; } - if (optind == argc) - errx (1, "no command given. Try rlogin if that's what you wanted."); + if (optind == argc) { + argv[0] = "rlogin"; + execvp ("rlogin", argv); + err (1, "execvp rlogin"); + } if (port_str) { struct servent *s = roken_getservbyname (port_str, "tcp");