octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57439] handles to private functions may fail


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #57439] handles to private functions may fail after "clear functions"
Date: Sat, 2 May 2020 15:17:54 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0

Follow-up Comment #53, bug #57439 (project octave):

For a test, I completely removed the letter case code from
canonicalize_file_name:

diff -r 1d090de50a0d liboctave/system/file-ops.cc
--- a/liboctave/system/file-ops.cc      Fri May 01 15:50:24 2020 +0200
+++ b/liboctave/system/file-ops.cc      Sat May 02 21:07:08 2020 +0200
@@ -714,7 +714,6 @@
 
 #if defined (OCTAVE_USE_WINDOWS_API)
       std::wstring w_tmp;
-      bool strip_marker = true;
       if (retval.empty ())
         {
           // For UNC paths, take the input as is.
@@ -724,39 +723,13 @@
           if (name_backsl.compare (0, 2, "\\\\") == 0)
             {
               w_tmp = u8_to_wstring (name_backsl);
-              strip_marker = false;
               wchar_t canon_path[MAX_PATH];
               if (PathCanonicalizeW (canon_path, w_tmp.c_str ()))
                 w_tmp = std::wstring (canon_path);
             }
-        }
-      else
-        w_tmp = L"\\\\?\\" + u8_to_wstring (retval);
 
-      if (! w_tmp.empty ())
-        {
-          // Get a more canonical name wrt case and full names
-          // FIXME: To make this work on partitions that don't store short
file
-          // names, use FindFirstFileW on each component of the path.
-          // Insufficient access permissions on parent folders might make
this
-          // tricky.
-
-          // Parts of the path that wouldn't fit into a short 8.3 file name
are
-          // copied as is by GetLongPathNameW.  To also get the correct case
-          // for these parts, first convert to short file names and than
back
-          // to long.
-          wchar_t buffer[32767] = L"";
-          int w_len = GetShortPathNameW (w_tmp.c_str (), buffer, 32767);
-          w_len = GetLongPathNameW (buffer, buffer, 32767);
-
-          if (! strip_marker)
-            retval = u8_from_wstring (std::wstring (buffer, w_len));
-          else if (w_len > 4)
-            retval = u8_from_wstring (std::wstring (buffer+4, w_len-4));
-
-          // If root is a drive, use an upper case letter for the drive
letter.
-          if (retval.length () > 1 && retval[1] == ':')
-            retval[0] = toupper (retval[0]);
+          if (! w_tmp.empty ())
+            retval = u8_from_wstring (w_tmp);
         }
 #endif
 


Even with this change, the test suite executes still pretty slow.
According to "Very Sleepy CS" about 80% of the execution time is spent in
"canonicalize_filename_mode" (I guess that is a gnulib module) effectively
called by "find_private_fcn". Most of the time there is spent in "rpl_stat".

@jwe: In comment #49, you wrote that there is a different way to check for
private functions. Is there anything I can do to help?

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57439>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]