cvs: php4 /ext/standard/ dl.c
| From: | Zeev Suraski | Date: | Fri, 09 Jun 2000 00:43:44 +0000 |
| Subject: | cvs: php4 /ext/standard/ dl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94@lists.php.net to get a copy of this message | ||
zeev Thu Jun 8 17:43:44 2000 EDT
Modified files:
/php4/ext/standard dl.c
Log:
Restore the check for the trailing slash. Windows does not apply s#/+#/# (PR 4375)
Index: php4/ext/standard/dl.c
diff -u php4/ext/standard/dl.c:1.42 php4/ext/standard/dl.c:1.43
--- php4/ext/standard/dl.c:1.42 Mon Jun 5 12:47:44 2000
+++ php4/ext/standard/dl.c Thu Jun 8 17:43:43 2000
@@ -75,6 +75,9 @@
#define USING_ZTS 0
#endif
+#define IS_SLASH(c) \
+ (((c)=='/') || ((c)=='\\'))
+
void php_dl(pval *file,int type,pval *return_value)
{
void *handle;
@@ -89,7 +92,11 @@
libpath = emalloc(extension_dir_len+file->value.str.len+2);
- sprintf(libpath,"%s/%s",PG(extension_dir),file->value.str.val);
+ if (IS_SLASH(PG(extension_dir)[extension_dir_len-1])) {
+ sprintf(libpath,"%s%s", PG(extension_dir), file->value.str.val); /* SAFE */
+ } else {
+ sprintf(libpath,"%s/%s", PG(extension_dir), file->value.str.val); /* SAFE */
+ }
} else {
libpath = estrndup(file->value.str.val, file->value.str.len);
}