summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-02-15 19:01:41 +0000
committerru <ru@FreeBSD.org>2001-02-15 19:01:41 +0000
commit48633da620e77246fedda745c9d5b8d769693b32 (patch)
tree608e1e0deaebc37be8a6108c49eaa47086da7fbc /gnu
parent11781a7431fab609cd00058a63ac09ccddb16854 (diff)
downloadFreeBSD-src-48633da620e77246fedda745c9d5b8d769693b32.zip
FreeBSD-src-48633da620e77246fedda745c9d5b8d769693b32.tar.gz
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.)
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/man/man/man.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c
index 03000bd..0fb6b87 100644
--- a/gnu/usr.bin/man/man/man.c
+++ b/gnu/usr.bin/man/man/man.c
@@ -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);
}
}
OpenPOWER on IntegriCloud