# HG changeset patch # User Markus Mützel # Date 1661276719 -7200 # Node ID 8d4c87e88d0e7744ec6cf8f05843968b8e3c2320 # Parent 776446acdc7b962571371a8a11acf22d276a78b9# Parent 4c38cf0ce06cf4a37a5eb37ec6f3235d5a62defd maint: Merge stable to default. diff -r 776446acdc7b -r 8d4c87e88d0e liboctave/system/file-ops.cc --- a/liboctave/system/file-ops.cc Fri Aug 19 08:54:05 2022 +0200 +++ b/liboctave/system/file-ops.cc Tue Aug 23 19:45:19 2022 +0200 @@ -750,11 +750,12 @@ // If the initial path looked like a mapped network drive, replace // portion of path that corresponds to mapped root with drive root. - if (name.size () < 2 || name[1] != ':') + if (name.size () < 3 || name[1] != ':') return retval; // UNC path corresponding to original drive letter (mappped drive) - std::wstring orig_map = wname.substr (0, 2); + std::wstring orig_map = wname.substr (0, 3); + orig_map[2] = L'\\'; HANDLE h_map = CreateFileW (orig_map.c_str (), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS