# HG changeset patch # User Markus Mützel # Date 1586276691 -7200 # Node ID 450fe5371acd65618f95cf9b4f60899f8ae8e6c2 # Parent 500937ff19d997a423fdb3cea2b4991246b0eada# Parent 6ea1e96b69d43c1e3e8ec65146892dc3f4f16aec maint: merge stable to default. diff -r 500937ff19d9 -r 450fe5371acd liboctave/system/file-ops.cc --- a/liboctave/system/file-ops.cc Mon Apr 06 17:31:37 2020 -0700 +++ b/liboctave/system/file-ops.cc Tue Apr 07 18:24:51 2020 +0200 @@ -718,12 +718,12 @@ if (retval.empty ()) { // For UNC paths, take the input as is. - // Also translate forward slashes. - retval = name; - std::replace (retval.begin (), retval.end (), '/', '\\'); - if (retval.compare (0, 2, "\\\\") == 0) + // Also translate forward slashes to backslashes. + std::string name_backsl = name; + std::replace (name_backsl.begin (), name_backsl.end (), '/', '\\'); + if (name_backsl.compare (0, 2, "\\\\") == 0) { - w_tmp = u8_to_wstring (retval); + w_tmp = u8_to_wstring (name_backsl); strip_marker = false; wchar_t canon_path[MAX_PATH]; if (PathCanonicalizeW (canon_path, w_tmp.c_str ()))