From 9ea89dbb777246f907abe4fe1a4b3b1c255f21f0 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 26 Sep 2019 11:16:57 -0500 Subject: Max 2 arguments with -T --- toys/posix/ln.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toys/posix/ln.c b/toys/posix/ln.c index fb47e911..f941290e 100644 --- a/toys/posix/ln.c +++ b/toys/posix/ln.c @@ -18,7 +18,7 @@ config LN -s Create a symbolic link -f Force the creation of the link, even if TO already exists -n Symlink at TO treated as file - -T TO always treated as file + -T TO always treated as file, max 2 arguments -v Verbose */ @@ -37,6 +37,7 @@ void ln_main(void) dest="."; } + if (FLAG(T) && toys.optc>1) help_exit("Max 2 arguments"); // Is destination a directory? if (!((FLAG(n)||FLAG(T)) ? lstat : stat)(dest, &buf)) { i = S_ISDIR(buf.st_mode); -- cgit v1.2.3