зеркало из https://github.com/mozilla/gecko-dev.git
23aebf1035
Currently, the GNU version of basename from string.h is used, which
has behavior that conflicts with the POSIX version in libgen.h.
The GNU basename is not available in all libcs. In particular, it
is missing in musl libc, causing a build failure:
error: 'basename' was not declared in this scope
The GNU version has the following implementation:
char *p = strrchr (filename, '/');
return p ? p + 1 : (char *) filename;
The POSIX version has slightly different semantics. It may modify
its argument string, or copy part of it to static storage. However,
it will also delete trailing slashes, while the GNU version will
return the empty string if there is a trailing slash.
This change resolves the issue by including libgen.h, adopting POSIX
basename semantics. This should be a safe change for the following
reasons:
- The google-breakpad code, from which this code was derived, has
also switched to the POSIX basename:
|
||
---|---|---|
.. | ||
bloatview | ||
browsertime | ||
clang-tidy | ||
code-coverage | ||
compare-locales | ||
coverity | ||
crashreporter | ||
fuzzing | ||
github-sync | ||
infer | ||
jprof | ||
leak-gauge | ||
lint | ||
moztreedocs | ||
performance | ||
power | ||
profiler | ||
quitter | ||
rb | ||
rewriting | ||
tryselect | ||
update-packaging | ||
update-verify | ||
vcs | ||
mach_commands.py | ||
moz.build |