From 89a4f6ff1f643aadc4d3e9e401d792b5198d9f52 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 7 Jul 2000 07:12:11 +0000 Subject: Update. 2000-07-07 Ulrich Drepper * locale/programs/locale.c (write_locales): Don't simply add all directories found in the subdir, test whether at least the LC_CTYPE file is in there. --- locale/programs/locale.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'locale') 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); -- cgit v1.2.3