# HG changeset patch # User Markus Mützel # Date 1661876790 -7200 # Node ID f111d1caa73d0ef7e82e9bd0d2f71a4a685ea5f4 # Parent 19bd1953fc1df845c83b2950379c97d43f44cf48 canonicalize_file_name: Trim trailing file separators from root of mapped network drive (bug #62847). * liboctave/system/file-ops.cc (canonicalize_file_name): Trim trailing file separators from root of mapped network drive before potentially replacing it in the canonicalized path. diff -r 19bd1953fc1d -r f111d1caa73d liboctave/system/file-ops.cc --- a/liboctave/system/file-ops.cc Tue Aug 30 11:16:27 2022 +0200 +++ b/liboctave/system/file-ops.cc Tue Aug 30 18:26:30 2022 +0200 @@ -778,6 +778,11 @@ return retval; orig_root = orig_root.erase (2, 6); + // trim trailing file separators from UNC path corresponding to root + std::string file_seps = file_ops::dir_sep_chars (); + while (file_seps.find (orig_root.back ()) != std::string::npos) + orig_root.pop_back (); + if (retval.compare (0, orig_root.size (), orig_root)) // start of UNC path doesn't match mapped drive root return retval;