aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/gdb/source.c b/gdb/source.c
index cb05939..c985a1b 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -932,21 +932,14 @@ substitute_path_rule_matches (const struct substitute_path_rule *rule,
{
const int from_len = strlen (rule->from);
const int path_len = strlen (path);
- char *path_start;
if (path_len < from_len)
return 0;
/* The substitution rules are anchored at the start of the path,
- so the path should start with rule->from. There is no filename
- comparison routine, so we need to extract the first FROM_LEN
- characters from PATH first and use that to do the comparison. */
+ so the path should start with rule->from. */
- path_start = alloca (from_len + 1);
- strncpy (path_start, path, from_len);
- path_start[from_len] = '\0';
-
- if (FILENAME_CMP (path_start, rule->from) != 0)
+ if (filename_ncmp (path, rule->from, from_len) != 0)
return 0;
/* Make sure that the region in the path that matches the substitution