Skip to content

Commit

Permalink
Use basename (3) for the %basename macro
Browse files Browse the repository at this point in the history
  • Loading branch information
ffesti committed Mar 5, 2024
1 parent 7f7a611 commit a380296
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions rpmio/macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -1301,10 +1301,7 @@ static void doFoo(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t argv, size_t *parsed)

if (rstreq("basename", me->name)) {
buf = xstrdup(argv[1]);
if ((b = strrchr(buf, '/')) == NULL)
b = buf;
else
b++;
b = basename(buf);
} else if (rstreq("dirname", me->name)) {
buf = xstrdup(argv[1]);
b = dirname(buf);
Expand Down

0 comments on commit a380296

Please sign in to comment.