On Thu, Jun 09, 2022 at 10:13:52AM +0200, Laszlo Ersek wrote:
Looks OK to me, I just suggest using a different function name
rather
than "basename". While the C code is certainly OK, conceptually we
already have two standard basename() functions, a POSIX compatible one
from <libgen.h>, and a glibc (_GNU_SOURCE) override.
(While looking for sources on this, I stumbled upon
<
https://nanxiao.me/en/beware-of-using-gnu-ibc-basename-function/>, so
apparently the glibc override does exactly what your version does. So I
think we should either rename the internal basename() to something else,
or just use (= statically link) the _GNU_SOURCE variant from glibc).
Renamed the function in my copy to "get_basename", and also deleted
the unnecessary include <assert.h>, left over from an earlier version
of the code.
Rich.
With that:
Acked-by: Laszlo Ersek <lersek(a)redhat.com>
Thanks
Laszlo
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v