From d1efb15a787cdc2079da456eb705f8652fad4040 Mon Sep 17 00:00:00 2001 From: Rogerio dos Santos Date: Wed, 29 Apr 2015 15:12:05 -0500 Subject: [PATCH 1/4] Introduced VxWorks Simulator root Introduced the root path for the VxWorks simulator. It the "host:" is not handled, this can cause infinite recursive call on VxWorks simulator when usinf the canonical function --- src/path.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/path.cpp b/src/path.cpp index 22a12854..f0a39357 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -537,6 +537,12 @@ namespace && is_separator(path[2])) return 2; # endif +# ifdef _VX_CPU + // case "host:" - VxWorks simulator + if (size > 5 + && path[4] == colon) return 5; +# endif + // case "//" if (size == 2 && is_separator(path[0]) From cfaf770c27d7c2aca3ad23d6b8d981dfb209206a Mon Sep 17 00:00:00 2001 From: Rogerio dos Santos Date: Thu, 28 May 2015 17:03:17 -0500 Subject: [PATCH 2/4] Corrected path canonical function Corrected path canonical function to handle properly path existence in some platforms where the root separator might not be a valid path. E.g.: On VxWorks the path "/" can be invalid but the path "/tgtsvr/" is a valid path. --- src/operations.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/operations.cpp b/src/operations.cpp index d8e8840c..c0654291 100644 --- a/src/operations.cpp +++ b/src/operations.cpp @@ -829,7 +829,15 @@ namespace detail bool is_sym (is_symlink(detail::symlink_status(result, ec))); if (ec && *ec) - return path(); + { + if (result == &path::preferred_separator && source != &path::preferred_separator) + { + ec->clear(); + continue; + } + + return path(); + } if (is_sym) { From 342007e4bb909000b795d9baf8ba9ce65c5c4942 Mon Sep 17 00:00:00 2001 From: Rogerio dos Santos Date: Thu, 28 May 2015 17:48:28 -0500 Subject: [PATCH 3/4] Revert "Corrected path canonical function" This reverts commit cfaf770c27d7c2aca3ad23d6b8d981dfb209206a. --- src/operations.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/operations.cpp b/src/operations.cpp index c0654291..d8e8840c 100644 --- a/src/operations.cpp +++ b/src/operations.cpp @@ -829,15 +829,7 @@ namespace detail bool is_sym (is_symlink(detail::symlink_status(result, ec))); if (ec && *ec) - { - if (result == &path::preferred_separator && source != &path::preferred_separator) - { - ec->clear(); - continue; - } - - return path(); - } + return path(); if (is_sym) { From d862d30a57887dd8d16d6f916b3a60f3cc276d93 Mon Sep 17 00:00:00 2001 From: Rogerio dos Santos Date: Thu, 28 May 2015 17:53:11 -0500 Subject: [PATCH 4/4] Corrected path canonical function Corrected path canonical function to handle properly path existence in some platforms where the root separator might not be a valid path. E.g.: On VxWorks the path "/" can be invalid but the path "/tgtsvr/" is a valid path. --- src/operations.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/operations.cpp b/src/operations.cpp index d8e8840c..d94552b3 100644 --- a/src/operations.cpp +++ b/src/operations.cpp @@ -397,6 +397,7 @@ namespace //--------------------------------------------------------------------------------------// const char dot = '.'; + const char* preferred_separator_string = "/"; bool not_found_error(int errval) { @@ -485,6 +486,7 @@ namespace const std::size_t buf_size=128; const wchar_t dot = L'.'; + const wchar_t* preferred_separator_string = L"\\"; bool not_found_error(int errval) { @@ -829,7 +831,15 @@ namespace detail bool is_sym (is_symlink(detail::symlink_status(result, ec))); if (ec && *ec) - return path(); + { + if (result == preferred_separator_string && source != preferred_separator_string) + { + ec->clear(); + continue; + } + + return path(); + } if (is_sym) {