]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(copy_internal): For each symlink copied by cp -r,
authorJim Meyering <jim@meyering.net>
Sat, 2 Mar 2002 17:16:42 +0000 (17:16 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 2 Mar 2002 17:16:42 +0000 (17:16 +0000)
issue a warning that `cp -r' is not portable.

src/copy.c

index 4da2b2190b1b600abe7cb6dde4a819392ca56af5..eb369b243e650f74dad2ed7103494499804f5835 100644 (file)
@@ -1406,6 +1406,12 @@ copy_internal (const char *src_path, const char *dst_path,
          goto un_backup;
        }
 
+      if (x->recursive && x->copy_as_regular)
+       {
+         error (0, 0, _("%s: WARNING: using -r to copy symbolic\
+ links is not portable"), quote (src_path));
+       }
+
       if (!symlink (src_link_val, dst_path))
        free (src_link_val);
       else