ishcherb / rpms / rpm

Forked from rpms/rpm 6 years ago
Clone
Blob Blame History Raw
--- rpm-4.4.2/tools/debugedit.c.jj	2007-04-20 21:27:50.000000000 +0200
+++ rpm-4.4.2/tools/debugedit.c	2007-04-20 23:07:27.000000000 +0200
@@ -371,9 +371,10 @@ canonicalize_path (const char *s, char *
 
       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 *
 		  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++ = *s++;
 	    }
 	}
-
       else
 	{
 	  while (*s && ! IS_DIR_SEPARATOR (*s))