Check for 3 and more arguments was incorrect
authorPavel Roskin <proski@gnu.org>
Sun, 18 Jun 2000 00:02:24 +0000 (00:02 -0000)
committerPavel Roskin <proski@gnu.org>
Sun, 18 Jun 2000 00:02:24 +0000 (00:02 -0000)
It is only allowed for linking to a directory
But linking to a directory still fails and may be removed

coreutils/ln.c
ln.c

index 634c9905dc8c2c0b161b493455919c5259936939..37148225121795e15d26b92e644d42da64ffb9a9 100644 (file)
@@ -96,7 +96,7 @@ extern int ln_main(int argc, char **argv)
 
        linkIntoDirFlag = isDirectory(linkName, TRUE, NULL);
 
-       if ((argc > 3) && !linkIntoDirFlag) {
+       if ((argc >= 3) && linkIntoDirFlag == FALSE) {
                fprintf(stderr, not_a_directory, "ln", linkName);
                exit FALSE;
        }
diff --git a/ln.c b/ln.c
index 634c9905dc8c2c0b161b493455919c5259936939..37148225121795e15d26b92e644d42da64ffb9a9 100644 (file)
--- a/ln.c
+++ b/ln.c
@@ -96,7 +96,7 @@ extern int ln_main(int argc, char **argv)
 
        linkIntoDirFlag = isDirectory(linkName, TRUE, NULL);
 
-       if ((argc > 3) && !linkIntoDirFlag) {
+       if ((argc >= 3) && linkIntoDirFlag == FALSE) {
                fprintf(stderr, not_a_directory, "ln", linkName);
                exit FALSE;
        }