]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Make dir2str return "/" if did == 1 and suf == NULL
authorMichael Schroeder <mls@suse.de>
Fri, 3 Mar 2017 15:48:40 +0000 (16:48 +0100)
committerMichael Schroeder <mls@suse.de>
Fri, 3 Mar 2017 15:48:40 +0000 (16:48 +0100)
It used to return "", which is wrong. did == 1 is somewhat of
a special case.

src/repodata.c

index 027c24c3ba09d34de4210181576da2135117bce3..06b2ea3e7196f20172e12f58d3ca98d5e501c319 100644 (file)
@@ -351,6 +351,8 @@ repodata_dir2str(Repodata *data, Id did, const char *suf)
 
   if (!did)
     return suf ? suf : "";
+  if (did == 1 && !suf)
+    return "/";
   parent = did;
   while (parent)
     {