diff options
author | Paul Nasrat <pnasrat@redhat.com> | 2007-04-23 10:49:31 +0100 |
---|---|---|
committer | Paul Nasrat <pnasrat@redhat.com> | 2007-04-23 10:49:31 +0100 |
commit | e0fe0e26eee361c20e960064162e3a7ad3bc63c9 (patch) | |
tree | 00474f7038e24e5b8cc71db51686d41af9c87426 /tools/debugedit.c | |
parent | 2b0bc853c3b6e575613e946c346d915fe289f811 (diff) | |
download | rpm-e0fe0e26eee361c20e960064162e3a7ad3bc63c9.tar.gz |
Fix debugedit for relative paths (#232222)
Diffstat (limited to 'tools/debugedit.c')
-rw-r--r-- | tools/debugedit.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/debugedit.c b/tools/debugedit.c index 23f4227ac..3ca9b28ea 100644 --- a/tools/debugedit.c +++ b/tools/debugedit.c @@ -371,9 +371,10 @@ canonicalize_path (const char *s, char *d) if (s[0] == '.' && (s[1] == 0 || IS_DIR_SEPARATOR (s[1]))) { - s ++; - if (!*s && d > droot) - d--; + s++; + if (*s) + while (IS_DIR_SEPARATOR (*s)) + ++s; } else if (s[0] == '.' && s[1] == '.' @@ -401,8 +402,6 @@ canonicalize_path (const char *s, char *d) if (*s) while (IS_DIR_SEPARATOR (*s)) s++; - else if (d > droot) - d--; } } else @@ -411,7 +410,6 @@ canonicalize_path (const char *s, char *d) *d++ = *s++; } } - else { while (*s && ! IS_DIR_SEPARATOR (*s)) |