Module Name:    src
Committed By:   christos
Date:           Thu Sep 19 21:19:13 UTC 2013

Modified Files:
        src/lib/libc/citrus: citrus_module.c

Log Message:
look in the right place for the modules of compat binaries


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_module.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_module.c
diff -u src/lib/libc/citrus/citrus_module.c:1.10 src/lib/libc/citrus/citrus_module.c:1.11
--- src/lib/libc/citrus/citrus_module.c:1.10	Mon Oct 15 18:22:01 2012
+++ src/lib/libc/citrus/citrus_module.c	Thu Sep 19 17:19:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_module.c,v 1.10 2012/10/15 22:22:01 msaitoh Exp $	*/
+/*	$NetBSD: citrus_module.c,v 1.11 2013/09/19 21:19:13 christos Exp $	*/
 
 /*-
  * Copyright (c)1999, 2000, 2001, 2002 Citrus Project,
@@ -89,7 +89,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_module.c,v 1.10 2012/10/15 22:22:01 msaitoh Exp $");
+__RCSID("$NetBSD: citrus_module.c,v 1.11 2013/09/19 21:19:13 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -302,12 +302,24 @@ _citrus_load_module(_citrus_module_t *rh
 
 	if (_pathI18nModule == NULL) {
 		p = getenv("PATH_I18NMODULE");
-		if (p != NULL && !issetugid()) {
+		if (p == NULL || issetugid()) {
+			_pathI18nModule = _PATH_I18NMODULE;
+#ifdef MLIBDIR
+			p = strrchr(_pathI18nModule, '/');
+			if (p != NULL && MLIBDIR[0]) {
+				snprintf(path, sizeof(path), "%.*s/%s/%s",
+				    (int)(p - _pathI18nModule),
+				    _pathI18nModule, MLIBDIR, p + 1);
+				p = path;
+			} else
+				p = NULL;
+#endif
+		}
+		if (p != NULL) {
 			_pathI18nModule = strdup(p);
 			if (_pathI18nModule == NULL)
 				return ENOMEM;
-		} else
-			_pathI18nModule = _PATH_I18NMODULE;
+		}
 	}
 
 	(void)snprintf(path, sizeof(path), "lib%s", encname);

Reply via email to