gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 2 May 2012 20:00:36 +0000 (20:00 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 2 May 2012 20:00:36 +0000 (20:00 +0000)
Fix --without-auto-load-safe-path for MS-Windows host platform.
* auto-load.c (filename_is_in_dir): Return 1 for DIR_LEN 0.

gdb/ChangeLog
gdb/auto-load.c

index 5356e14008eb220e4bb7ca81bd1a2e9f9a40ce43..e544f898ae1a7895ffafabc08e6e2e7d75ca0830 100644 (file)
@@ -1,3 +1,8 @@
+2012-05-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix --without-auto-load-safe-path for MS-Windows host platform.
+       * auto-load.c (filename_is_in_dir): Return 1 for DIR_LEN 0.
+
 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
 
        * gdb_curses.h: Undefine KEY_EVENT before including curses
index 9d19179feb94a23f90cb1408224b3fbd218a59bc..187e8520f9a72725800cc6a2488044282d3aa09a 100644 (file)
@@ -231,6 +231,12 @@ filename_is_in_dir (const char *filename, const char *dir)
   while (dir_len && IS_DIR_SEPARATOR (dir[dir_len - 1]))
     dir_len--;
 
+  /* Ensure auto_load_safe_path "/" matches any FILENAME.  On MS-Windows
+     platform FILENAME even after gdb_realpath does not have to start with
+     IS_DIR_SEPARATOR character, such as the 'C:\x.exe' filename.  */
+  if (dir_len == 0)
+    return 1;
+
   return (filename_ncmp (dir, filename, dir_len) == 0
          && (IS_DIR_SEPARATOR (filename[dir_len])
              || filename[dir_len] == '\0'));
This page took 0.039126 seconds and 4 git commands to generate.