summaryrefslogtreecommitdiff
path: root/tools/debugedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/debugedit.c')
-rw-r--r--tools/debugedit.c10
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))