Mercurial > octave
diff liboctave/system/file-ops.cc @ 31216:f111d1caa73d stable
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.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Tue, 30 Aug 2022 18:26:30 +0200 |
parents | 4c38cf0ce06c |
children | 6a5e4ef80a95 |
line wrap: on
line diff
--- 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;