From c99249e32dddd562e3327a5326c60083cbbc1b5c Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 23 Jul 2010 17:39:31 +0200 Subject: [PATCH] build-locale-archive: process only directories matching *_* --- fedora/build-locale-archive.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fedora/build-locale-archive.c b/fedora/build-locale-archive.c index f68c7882205..474f666a441 100644 --- a/fedora/build-locale-archive.c +++ b/fedora/build-locale-archive.c @@ -561,7 +561,7 @@ int main () { char *ptr = malloc (strlen (primary) + strlen (".utf8") + 1), *p, *q; - if (ptr) + if (ptr != NULL) { p = ptr; q = primary; @@ -585,6 +585,8 @@ int main () { if (strcmp (d->d_name, ".") == 0 || strcmp (d->d_name, "..") == 0) continue; + if (strchr (d->d_name, '_') == NULL) + continue; size_t d_name_len = strlen (d->d_name); if (loc_path_len + d_name_len + 1 > sizeof (path)) @@ -602,7 +604,10 @@ int main () if (! S_ISDIR (st.st_mode)) continue; if (cnt == 16384) - error (EXIT_FAILURE, 0, "too many directories in \"%s\"", loc_path); + { + error (0, 0, "too many directories in \"%s\"", loc_path); + break; + } list[cnt] = strdup (path); if (list[cnt] == NULL) { -- 2.47.2