From 2988eab3dc35d863e4838b29a3ec0d8dc3586bb9 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 1 May 2008 12:43:29 +0000 Subject: [PATCH] Added support for option '-L' (always dereference symbolic links). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25279 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tools/fs_shell/command_cp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/fs_shell/command_cp.cpp b/src/tools/fs_shell/command_cp.cpp index f09bb2d1da..9b6145a98c 100644 --- a/src/tools/fs_shell/command_cp.cpp +++ b/src/tools/fs_shell/command_cp.cpp @@ -45,6 +45,7 @@ struct Options { attributesOnly(false), ignoreAttributes(false), dereference(true), + alwaysDereference(false), force(false), recursive(false) { @@ -54,6 +55,7 @@ struct Options { bool attributesOnly; bool ignoreAttributes; bool dereference; + bool alwaysDereference; bool force; bool recursive; }; @@ -966,7 +968,7 @@ copy_dir_contents(FSDomain *sourceDomain, const char *source, PathDeleter targetDeleter(targetEntry); fssh_status_t error = copy_entry(sourceDomain, sourceEntry, - targetDomain, targetEntry, options, false); + targetDomain, targetEntry, options, options.alwaysDereference); if (error != FSSH_B_OK) return error; } @@ -1260,6 +1262,10 @@ command_cp(int argc, const char* const* argv) case 'f': options.force = true; break; + case 'L': + options.dereference = true; + options.alwaysDereference = true; + break; case 'r': options.recursive = true; break;