@ffesti commented on this pull request.


> @@ -1306,9 +1307,9 @@ static void doFoo(rpmMacroBuf mb, rpmMacroEntry me, 
> ARGV_t argv, size_t *parsed)
            b++;
     } else if (rstreq("dirname", me->name)) {
        buf = xstrdup(argv[1]);
-       if ((b = strrchr(buf, '/')) != NULL)
-           *b = '\0';
-       b = buf;
+       b = xstrdup(dirname(buf));

Yeah, I figured that myself but it took me a while to figure out that the 
simplest solution actually works. dirname and basename are a bit weird memory 
handling wise.

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

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

Reply via email to