diff options
author | Alan Modra <amodra@gmail.com> | 2021-09-20 12:15:20 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-09-20 14:01:11 +0930 |
commit | d467335403fda3c4774e27d9725b3528e1799398 (patch) | |
tree | 2e562724170464e3905e798f955f0f8999752c66 /gas | |
parent | 5b4846283c3d49138a58a3bb4d61ed3e2dfffff4 (diff) | |
download | gdb-d467335403fda3c4774e27d9725b3528e1799398.zip gdb-d467335403fda3c4774e27d9725b3528e1799398.tar.gz gdb-d467335403fda3c4774e27d9725b3528e1799398.tar.bz2 |
Fix allocate_filenum last dir/file checks
* dwarf2dbg.c (allocate_filenum) Correct use of last_used_dir_len.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/dwarf2dbg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index e2abe19..c6e439a 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -730,9 +730,9 @@ allocate_filenum (const char * pathname) } else { - if (filename_ncmp (pathname, dirname, last_used_dir_len) == 0 - && IS_DIR_SEPARATOR (pathname [last_used_dir_len]) - && filename_cmp (pathname + last_used_dir_len + 1, + if (filename_ncmp (pathname, dirname, last_used_dir_len - 1) == 0 + && IS_DIR_SEPARATOR (pathname [last_used_dir_len - 1]) + && filename_cmp (pathname + last_used_dir_len, files[last_used].filename) == 0) return last_used; } |