changeset 105:68b84c20ca1e

Fix for "-l" scp option
author Matt Johnston <matt@ucc.asn.au>
date Tue, 24 Aug 2004 05:05:48 +0000
parents 298098b2a61e
children e13f8a712a1c
files cli-runopts.c scp.c
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/cli-runopts.c	Tue Aug 24 04:12:08 2004 +0000
+++ b/cli-runopts.c	Tue Aug 24 05:05:48 2004 +0000
@@ -143,12 +143,6 @@
 		if (argv[i][0] == '-') {
 			/* A flag *waves* */
 
-			if (strlen(argv[i]) > 2) {
-					fprintf(stderr, 
-						"WARNING: Ignoring unknown argument '%s'\n", argv[i]);
-					continue;
-			}
-
 			switch (argv[i][1]) {
 				case 'p': /* remoteport */
 					next = &cli_opts.remoteport;
@@ -205,6 +199,12 @@
 						"WARNING: Ignoring unknown argument '%s'\n", argv[i]);
 					break;
 			} /* Switch */
+			
+			/* Now we handle args where they might be "-luser" (no spaces)*/
+			if (next && strlen(argv[i]) > 2) {
+				*next = &argv[i][2];
+				next = NULL;
+			}
 
 			continue; /* next argument */
 
--- a/scp.c	Tue Aug 24 04:12:08 2004 +0000
+++ b/scp.c	Tue Aug 24 05:05:48 2004 +0000
@@ -178,8 +178,10 @@
 		close(pout[1]);
 
 		args.list[0] = ssh_program;
-		if (remuser != NULL)
-			addargs(&args, "-l%s", remuser);
+		if (remuser != NULL) {
+			addargs(&args, "-l");
+			addargs(&args, "%s", remuser);
+		}
 		addargs(&args, "%s", host);
 		addargs(&args, "%s", cmd);