Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-09-15 21:52:19 +0000
committereutarass2011-09-15 21:52:19 +0000
commitdd35bbcb9f7a798a1cdfb03822ee924cf0ddfc46 (patch)
tree700bebf347ef9de502c71c0e0e381c71e2dfbcc1
parentbb0dc52ee189cf50ebc4a4306058c71c6b3fad6c (diff)
downloadorg.eclipse.tcf.agent-dd35bbcb9f7a798a1cdfb03822ee924cf0ddfc46.tar.gz
org.eclipse.tcf.agent-dd35bbcb9f7a798a1cdfb03822ee924cf0ddfc46.tar.xz
org.eclipse.tcf.agent-dd35bbcb9f7a798a1cdfb03822ee924cf0ddfc46.zip
TCF Agent: fixed: line_to_address() broken by "added code to convert path map file names to canonical form before using them in comparisons".
-rw-r--r--services/linenumbers_elf.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/services/linenumbers_elf.c b/services/linenumbers_elf.c
index 3674ca26..96e305aa 100644
--- a/services/linenumbers_elf.c
+++ b/services/linenumbers_elf.c
@@ -61,28 +61,25 @@ static int compare_path(Channel * chnl, Context * ctx, char * file, char * pwd,
if (name == NULL) return 0;
if (is_absolute_path(name)) {
- full_name = canonic_path_map_file_name(name);
+ full_name = name;
}
else if (dir != NULL && is_absolute_path(dir)) {
- snprintf(buf, sizeof(buf), "%s/%s", dir, name);
- full_name = canonic_path_map_file_name(buf);
+ snprintf(full_name = buf, sizeof(buf), "%s/%s", dir, name);
}
else if (dir != NULL && pwd != NULL) {
- snprintf(buf, sizeof(buf), "%s/%s/%s", pwd, dir, name);
- full_name = canonic_path_map_file_name(buf);
+ snprintf(full_name = buf, sizeof(buf), "%s/%s/%s", pwd, dir, name);
}
else if (pwd != NULL) {
- snprintf(buf, sizeof(buf), "%s/%s", pwd, name);
- full_name = canonic_path_map_file_name(buf);
+ snprintf(full_name = buf, sizeof(buf), "%s/%s", pwd, name);
}
else {
- full_name = canonic_path_map_file_name(name);
+ full_name = name;
}
+ full_name = canonic_path_map_file_name(full_name);
#if SERVICE_PathMap
- {
- char * cnm = apply_path_map(chnl, ctx, full_name, PATH_MAP_TO_CLIENT);
- if (cnm != full_name) full_name = canonic_path_map_file_name(cnm);
- }
+ if (full_name != buf) strlcpy(buf, full_name, sizeof(buf));
+ full_name = apply_path_map(chnl, ctx, buf, PATH_MAP_TO_CLIENT);
+ if (full_name != buf) full_name = canonic_path_map_file_name(full_name);
#endif
i = strlen(file);
j = strlen(full_name);

Back to the top