aboutsummaryrefslogtreecommitdiff
path: root/locale/programs/locale.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs/locale.c')
-rw-r--r--locale/programs/locale.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 0fcc2599e1..c37dad8649 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -336,7 +336,20 @@ write_locales (void)
}
if (S_ISDIR (mode))
- PUT (strdup (dirent->d_name));
+ {
+ /* Test whether at least the LC_CTYPE data is there. Some
+ directories only contain translations. */
+ char buf[sizeof (LOCALEDIR) + strlen (dirent->d_name)
+ + sizeof "/LC_CTYPE"];
+ struct stat st;
+
+ stpcpy (stpcpy (stpcpy (stpcpy (buf, LOCALEDIR), "/"),
+ dirent->d_name),
+ "/LC_CTYPE");
+
+ if (stat (buf, &st) == 0 && S_ISREG (st.st_mode))
+ PUT (strdup (dirent->d_name));
+ }
}
closedir (dir);