diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-05-02 20:00:36 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-05-02 20:00:36 +0000 |
commit | 1ef7171746433c3161d7d4b3c50a93f67d52c4a2 (patch) | |
tree | 89579fdd960e50cca3c1338964ac3081908e8176 | |
parent | 959fb20661e0334a6c5a71a0f686cb08eee2c669 (diff) | |
download | gdb-1ef7171746433c3161d7d4b3c50a93f67d52c4a2.zip gdb-1ef7171746433c3161d7d4b3c50a93f67d52c4a2.tar.gz gdb-1ef7171746433c3161d7d4b3c50a93f67d52c4a2.tar.bz2 |
gdb/
Fix --without-auto-load-safe-path for MS-Windows host platform.
* auto-load.c (filename_is_in_dir): Return 1 for DIR_LEN 0.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/auto-load.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5356e14..e544f89 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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 diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 9d19179..187e852 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -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')); |