changeset 27607:1397742ea0fe

fix removing temporary dir from path in windows (bug #57146) * load-path.cc: canonicalize path name before trying to remove it from the load path
author Torsten Lilge <ttl-octave@mailbox.org>
date Fri, 01 Nov 2019 20:47:13 +0100
parents 41a7902b99d4
children 994db4a60d10
files libinterp/corefcn/load-path.cc
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/load-path.cc	Fri Nov 01 16:22:01 2019 +0100
+++ b/libinterp/corefcn/load-path.cc	Fri Nov 01 20:47:13 2019 +0100
@@ -2633,11 +2633,15 @@
       std::string arg = args(i).xstring_value ("rmpath: all arguments must be strings");
       std::list<std::string> dir_elts = octave::split_path (arg);
 
-      for (const auto& dir : dir_elts)
+      for (auto dir : dir_elts)
         {
           //dir = regexprep (dir_elts{j}, '//+', "/");
           //dir = regexprep (dir, '/$', "");
 
+          std::string canonical_dir = octave::sys::canonicalize_file_name (dir);
+          if (! canonical_dir.empty ())
+            dir = canonical_dir;
+
           if (! lp.remove (dir))
             warning ("rmpath: %s: not found", dir.c_str ());
           else