Skip to content

Switch to GNU basename in ffi.util#804

Merged
NiLuJe merged 3 commits into
koreader:masterfrom
NiLuJe:master
Feb 7, 2019
Merged

Switch to GNU basename in ffi.util#804
NiLuJe merged 3 commits into
koreader:masterfrom
NiLuJe:master

Conversation

@NiLuJe

@NiLuJe NiLuJe commented Feb 7, 2019

Copy link
Copy Markdown
Member

The POSIX variant is unavailable on Android (c.f., #4543).

Fix koreader/koreader#4543

@NiLuJe

NiLuJe commented Feb 7, 2019

Copy link
Copy Markdown
Member Author

Note that, even in C, it's potentially tricky to end up with the GNU version:

NOTES
       There are two different versions of basename() - the POSIX version described above, and the GNU version, which one gets after

               #define _GNU_SOURCE         /* See feature_test_macros(7) */
               #include <string.h>

       The GNU version never modifies its argument, and returns the empty string when path has a trailing slash, and in particular also when it is "/".  There is no GNU version of dirname().

       With glibc, one gets the POSIX version of basename() when <libgen.h> is included, and the GNU version otherwise.

i.e., Even w/ _GNU_SOURCE, if you include <libgen.h>, which you need for dirname, you're screwed without a bit of extra hackiness

Comment thread ffi-cdecl/posix_decl.c Outdated
@NiLuJe

NiLuJe commented Feb 7, 2019

Copy link
Copy Markdown
Member Author

Done ;).

Took the opportunity to switch lpeg to a mirror, as upstream still appears to be down.

@Frenzie

Frenzie commented Feb 7, 2019

Copy link
Copy Markdown
Member

Does Gentoo also keep older versions around?

@Frenzie

Frenzie commented Feb 7, 2019

Copy link
Copy Markdown
Member

Anyway, lgtm.

@NiLuJe

NiLuJe commented Feb 7, 2019

Copy link
Copy Markdown
Member Author

Yeah, the distfiles mirrors keep the files mirrored as long as there's an ebuild in the tree matching that version.

@NiLuJe

NiLuJe commented Feb 7, 2019

Copy link
Copy Markdown
Member Author

(Note to self: rebase).

The POSIX variant is unavailable on Android (c.f., #4543).
Because apparently moving submodules broke checkouts on older tags?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants