# HG changeset patch # User Markus Mützel # Date 1581280716 -3600 # Node ID b70b9eaaf751ee8f7f7ac664ac2183259e022c36 # Parent 118606de93598b7d58ad10368da1942c76b72ca7 Actually canonicalize UNC paths (bug #57439). * file-ops.cc (canonicalize_file_name): Call PathCanonicalizeW on UNC paths. * configure.ac: Add check for shlwapi library. diff -r 118606de9359 -r b70b9eaaf751 configure.ac --- a/configure.ac Fri Oct 25 19:00:03 2019 +0200 +++ b/configure.ac Sun Feb 09 21:38:36 2020 +0100 @@ -1267,6 +1267,16 @@ ;; esac +## Windows-specific module used for canonical UNC paths +case $host_os in + msdosmsvc | mingw*) + AC_CHECK_HEADERS([shlwapi.h], + [LIBS="-lshlwapi $LIBS"], + [AC_MSG_ERROR([Missing SHLWAPI required to build for Windows target.])], + [#include ]) + ;; +esac + ## Cygwin kluge for getrusage. AC_CHECK_FUNCS([getrusage]) case $host_os in diff -r 118606de9359 -r b70b9eaaf751 liboctave/system/file-ops.cc --- a/liboctave/system/file-ops.cc Fri Oct 25 19:00:03 2019 +0200 +++ b/liboctave/system/file-ops.cc Sun Feb 09 21:38:36 2020 +0100 @@ -37,6 +37,7 @@ #endif #if defined (OCTAVE_USE_WINDOWS_API) # include +# include #endif #include @@ -723,6 +724,9 @@ { w_tmp = u8_to_wstring (retval); strip_marker = false; + wchar_t canon_path[MAX_PATH]; + if (PathCanonicalizeW (canon_path, w_tmp.c_str ())) + w_tmp = std::wstring (canon_path); } } else