We only ever use and want the gnu behavior, that doesn't modify the argument. Which is the proper thing to do for a basename() implementation.
I agree, but as I just stated in my comment to the patch below, if you don't want POSIX basename() behaviour, you probably should not use basename(). GNU should have named its own (admittedly better) version differently; it's just less error-prone to have different symbols for different things, and I don't think it's a good idea to tie a project to this particular GNU bit of carelessness.
There's a pending patch I need to review: https://github.com/kmod-project/kmod/pull/32 does that fix it for you?
Absolutely, this patch is way better than mine and I should have thought
of looking for something similar before submitting mine. Please merge Khem's patch. :) -- Laurent