mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
Do not ever try to look into nonexisting locale subdirectories.
(is_directory() returns -1 if the file does not exist, 1 if it is a directory or a symlink to a directory, and 0 otherwise.)
This commit is contained in:
parent
608a3ce62a
commit
5d56fa0cc6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72522
@ -1591,15 +1591,15 @@ man (name)
|
||||
if (locale != NULL) {
|
||||
locale_opts = locale_nroff;
|
||||
snprintf(buf, sizeof(buf), "%s/%s", *mp, locale);
|
||||
if (is_directory (buf))
|
||||
if (is_directory (buf) == 1)
|
||||
l_found = try_section (buf, section, name, glob);
|
||||
if (!l_found) {
|
||||
snprintf(buf, sizeof(buf), "%s/%s", *mp, short_locale);
|
||||
if (is_directory (buf))
|
||||
if (is_directory (buf) == 1)
|
||||
l_found = try_section (buf, section, name, glob);
|
||||
if (!l_found && (*short_locale != 'e' || *(short_locale + 1) != 'n')) {
|
||||
snprintf(buf, sizeof(buf), "%s/en.%s", *mp, short_locale + 3);
|
||||
if (is_directory (buf))
|
||||
if (is_directory (buf) == 1)
|
||||
l_found = try_section (buf, section, name, glob);
|
||||
}
|
||||
}
|
||||
@ -1633,15 +1633,15 @@ man (name)
|
||||
if (locale != NULL) {
|
||||
locale_opts = locale_nroff;
|
||||
snprintf(buf, sizeof(buf), "%s/%s", *mp, locale);
|
||||
if (is_directory (buf))
|
||||
if (is_directory (buf) == 1)
|
||||
l_found = try_section (buf, *sp, name, glob);
|
||||
if (!l_found) {
|
||||
snprintf(buf, sizeof(buf), "%s/%s", *mp, short_locale);
|
||||
if (is_directory (buf))
|
||||
if (is_directory (buf) == 1)
|
||||
l_found = try_section (buf, *sp, name, glob);
|
||||
if (!l_found && (*short_locale != 'e' || *(short_locale + 1) != 'n')) {
|
||||
snprintf(buf, sizeof(buf), "%s/en.%s", *mp, short_locale + 3);
|
||||
if (is_directory (buf))
|
||||
if (is_directory (buf) == 1)
|
||||
l_found = try_section (buf, *sp, name, glob);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user