cvs: /php4/ext/standard dl.c
| From: | Sascha Schumann | Date: | Thu, 30 Mar 2000 12:56:29 +0000 |
| Subject: | cvs: /php4/ext/standard dl.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12873@lists.php.net to get a copy of this message | ||
sas Thu Mar 30 04:56:29 2000 EDT
Modified files:
/php4/ext/standard dl.c
Log:
Allocate enough memory for additional /.
Also remove the extra check for the trailing /. Unix will automatically
apply s#/+#/#
Partly suggested by: drew@elysium.ltd.uk
PR: #3956
Index: php4/ext/standard/dl.c
diff -u php4/ext/standard/dl.c:1.33 php4/ext/standard/dl.c:1.34
--- php4/ext/standard/dl.c:1.33 Wed Mar 29 17:21:03 2000
+++ php4/ext/standard/dl.c Thu Mar 30 04:55:59 2000
@@ -88,13 +88,9 @@
&& PG(extension_dir)[0]){
int extension_dir_len = strlen(PG(extension_dir));
- libpath = emalloc(extension_dir_len+file->value.str.len+1);
+ libpath = emalloc(extension_dir_len+file->value.str.len+2);
- if (PG(extension_dir)[extension_dir_len-1]=='/' ||
PG(extension_dir)[extension_dir_len-1]=='\\') {
- sprintf(libpath,"%s%s",PG(extension_dir),file->value.str.val);
- } else {
- sprintf(libpath,"%s/%s",PG(extension_dir),file->value.str.val);
- }
+ sprintf(libpath,"%s/%s",PG(extension_dir),file->value.str.val);
} else {
libpath = estrndup(file->value.str.val, file->value.str.len);
}