summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Esser <sesser@php.net>2004-05-28 13:38:19 +0000
committerStefan Esser <sesser@php.net>2004-05-28 13:38:19 +0000
commitb9d3aafe553a4f7f302379830797966c92476322 (patch)
tree6e50376de15cbb3995213cb04c3d60603f28505f
parent7966bb11864a004adabe235f329a0d5c7c213c68 (diff)
downloadphp-git-b9d3aafe553a4f7f302379830797966c92476322.tar.gz
MFH
-rw-r--r--ext/standard/http_fopen_wrapper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 921f2647f2..d861072aba 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -467,7 +467,12 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
char *s = strrchr(resource->path, '/');
if (!s) {
s = resource->path;
- *s = '/';
+ if (!s[0]) {
+ efree(s);
+ s = resource->path = estrdup("/");
+ } else {
+ *s = '/';
+ }
}
s[1] = '\0';
if (resource->path && *(resource->path) == '/' && *(resource->path + 1) == '\0') {