jfb2 writes in Bug 119:
[oweals/busybox.git] / coreutils / ln.c
index 0640c666611e9a6d5d475643717864a5cac3ad9d..885ba61dbd9c3febc70fbb51605135f8cd077042 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Mini ln implementation for busybox
  *
- * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -73,8 +73,7 @@ extern int ln_main(int argc, char **argv)
                        free(src_name);
                        src_name = src;
                }
-
-               if (stat(*argv, &statbuf)) {
+               if (!(flag & LN_SYMLINK) && stat(*argv, &statbuf)) {
                        bb_perror_msg(*argv);
                        status = EXIT_FAILURE;
                        free(src_name);
@@ -89,25 +88,15 @@ extern int ln_main(int argc, char **argv)
                if (flag & LN_SYMLINK) {
                        link_func = symlink;
                }
-               
+
                if (link_func(*argv, src) != 0) {
                        bb_perror_msg(src);
                        status = EXIT_FAILURE;
                }
 
                free(src_name);
-               
+
        } while ((++argv)[1]);
 
        return status;
 }
-
-
-
-
-
-
-
-
-
-