apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r469166 - /apr/apr-iconv/branches/STATIC_MODULES/lib/iconv_module.c
Date Mon, 30 Oct 2006 15:40:49 GMT
Author: mturk
Date: Mon Oct 30 07:40:48 2006
New Revision: 469166

URL: http://svn.apache.org/viewvc?view=rev&rev=469166
Log:
Lowercase the requested module name like for dynamic module loading.

Modified:
    apr/apr-iconv/branches/STATIC_MODULES/lib/iconv_module.c

Modified: apr/apr-iconv/branches/STATIC_MODULES/lib/iconv_module.c
URL: http://svn.apache.org/viewvc/apr/apr-iconv/branches/STATIC_MODULES/lib/iconv_module.c?view=diff&rev=469166&r1=469165&r2=469166
==============================================================================
--- apr/apr-iconv/branches/STATIC_MODULES/lib/iconv_module.c (original)
+++ apr/apr-iconv/branches/STATIC_MODULES/lib/iconv_module.c Mon Oct 30 07:40:48 2006
@@ -531,9 +531,17 @@
 iconv_smopen(const char *name, void **dpp)
 {
 
-    iconv_module_desc_t *module = static_iconv_module_find(name);
+    char buffer[APR_PATH_MAX];
+    char *ptr;
+    iconv_module_desc_t *module;
+
+    if (apr_tolower(name[0]) == 'x' && name[1] == '-')
+        name += 2;
+    ptr = buffer;
+    while (0 != (*ptr++ = apr_tolower(*name++)))
+    module = static_iconv_module_find(buffer);
     if (!module) {
-        const char *alias = charset_alias_find(name);
+        const char *alias = charset_alias_find(buffer);
         if (alias) {
             if ((module = static_iconv_module_find(alias))) {
                 *dpp = module;
@@ -649,7 +657,7 @@
 	int error;
 	
 	/* Try to load the built-in modules first */
-	error = iconv_smopen(buffer, (void**)&mdesc);
+	error = iconv_smopen(modname, (void**)&mdesc);
 	if (error) {
 		if (iconv_getpath(buffer, modname, ctx) != 0)
 			return EINVAL;



Mime
View raw message