summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-09-04 08:19:03 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-09-04 08:19:03 +0300
commit283d4372ec4d3d651134a1dd6ec59d689ea27cd8 (patch)
treebd6158064144253a83907b862557ed1df71fa775 /tools
parentffea910c37f668de2e073bb57e656fe81a313586 (diff)
downloadrpm-283d4372ec4d3d651134a1dd6ec59d689ea27cd8.tar.gz
rpm-283d4372ec4d3d651134a1dd6ec59d689ea27cd8.tar.bz2
rpm-283d4372ec4d3d651134a1dd6ec59d689ea27cd8.zip
Debugedit fixes.
This makes debugedit's -l file get files that already match the -d rewrite directory, not just those that match the -b build directory and get rewritten. Patch from Roland McGrath
Diffstat (limited to 'tools')
-rw-r--r--tools/debugedit.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/tools/debugedit.c b/tools/debugedit.c
index 5b834fda6..ad81813d4 100644
--- a/tools/debugedit.c
+++ b/tools/debugedit.c
@@ -567,23 +567,22 @@ edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase)
memcpy (s + comp_dir_len + 1 + dir_len + 1, file, file_len + 1);
}
canonicalize_path (s, s);
- if (base_dir == NULL ||
- has_prefix (s, base_dir))
+ if (list_file_fd != -1)
{
- char *p;
- size_t size;
- ssize_t ret;
- if (base_dir)
- p = s + strlen (base_dir);
- else
+ char *p = NULL;
+ if (base_dir == NULL)
p = s;
-
- if (list_file_fd != -1)
+ else if (has_prefix (s, base_dir))
+ p = s + strlen (base_dir);
+ else if (has_prefix (s, dest_dir))
+ p = s + strlen (dest_dir);
+
+ if (p)
{
- size = strlen (p) + 1;
+ size_t size = strlen (p) + 1;
while (size > 0)
{
- ret = write (list_file_fd, p, size);
+ ssize_t ret = write (list_file_fd, p, size);
if (ret == -1)
break;
size -= ret;