changeset 31217:1469658f769b

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 30 Aug 2022 18:27:00 +0200
parents 5573b1d511c9 (current diff) f111d1caa73d (diff)
children ad9822dedef8
files
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/system/file-ops.cc	Tue Aug 30 11:16:55 2022 +0200
+++ b/liboctave/system/file-ops.cc	Tue Aug 30 18:27:00 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;