aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-09-26 11:16:57 -0500
committerRob Landley <rob@landley.net>2019-09-26 11:16:57 -0500
commit9ea89dbb777246f907abe4fe1a4b3b1c255f21f0 (patch)
tree4a707649279a4ccdad337f2adcadf6f62eb5e181 /toys/posix
parent9837e2bfaea0c703c5f4cfd81d1fedb478806ea8 (diff)
downloadtoybox-9ea89dbb777246f907abe4fe1a4b3b1c255f21f0.tar.gz
Max 2 arguments with -T
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/ln.c3
1 files changed, 2 insertions, 1 deletions
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);