@ffesti commented on this pull request.


> +     if (!strcmp(buf, "")) {
+           buf = rstrcat(&buf, ".");
+       } else if (strcmp(buf, ".") && strcmp(buf, "..") && strcmp(buf, "/")) {
+           /* strip trailing / */
+           size_t l = strlen(buf);
+           if (buf[l-1] == '/')
+               buf[l-1] = '\0';
+           if ((b = strrchr(buf, '/')) != NULL)
+               if (b == buf)
+                   /* keep root dir */
+                   buf[1] = '\0';
+               else
+                   *b = '\0';
+           else
+               strcpy(buf, ".");
+       }

Good question. Why didn't the code used that in the first place...?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2945#discussion_r1512763930
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2945/review/1916792...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to