cvs: php4 /ext/standard/ dl.c

From: Date: Mon, 12 Jun 2000 21:01:04 +0000
Subject: cvs: php4 /ext/standard/ dl.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-214@lists.php.net to get a copy of this message
zeev Mon Jun 12 14:01:04 2000 EDT Modified files: /php4/ext/standard dl.c Log: Fix a bug in extension_dir, where PG(extension_dir) is not yet initialized by the time php_dl() is called Index: php4/ext/standard/dl.c diff -u php4/ext/standard/dl.c:1.44 php4/ext/standard/dl.c:1.45 --- php4/ext/standard/dl.c:1.44 Mon Jun 12 13:22:16 2000 +++ php4/ext/standard/dl.c Mon Jun 12 14:01:03 2000 @@ -88,24 +88,35 @@ zend_module_entry *module_entry,*tmp; zend_module_entry *(*get_module)(void); int error_type; + char *extension_dir; PLS_FETCH(); ELS_FETCH(); + + if (type==MODULE_PERSISTENT) { + /* Use the configuration hash directly */ + if (cfg_get_string("extension_dir", &extension_dir)==FAILURE) { + extension_dir = NULL; + } + } else { + extension_dir = PG(extension_dir); + } + if (type==MODULE_TEMPORARY) { error_type = E_WARNING; } else { error_type = E_CORE_WARNING; } - if (PG(extension_dir) && PG(extension_dir)[0]){ - int extension_dir_len = strlen(PG(extension_dir)); + if (extension_dir && extension_dir[0]){ + int extension_dir_len = strlen(extension_dir); libpath = emalloc(extension_dir_len+file->value.str.len+2); - if (IS_SLASH(PG(extension_dir)[extension_dir_len-1])) { - sprintf(libpath,"%s%s", PG(extension_dir), file->value.str.val); /* SAFE */ + if (IS_SLASH(extension_dir[extension_dir_len-1])) { + sprintf(libpath,"%s%s", extension_dir, file->value.str.val); /* SAFE */ } else { - sprintf(libpath,"%s/%s", PG(extension_dir), file->value.str.val); /* SAFE */ + sprintf(libpath,"%s/%s", extension_dir, file->value.str.val); /* SAFE */ } } else { libpath = estrndup(file->value.str.val, file->value.str.len);

« previous php.cvs (#214) next »