[PATCH] Streams "file://" bug

php.internals

Cristiano Duarte

22 years ago
Hi all, The current implementation of file:// support under main/streams/strems.c has a little bug. Maybe it's my gcc 3.2.2 compiler... I don't know... Anyway, the attached patch fixes it. Best Regards, Cristiano Duarte

Sara Golemon

22 years ago
> The current implementation of file:// support under > main/streams/strems.c has a little bug. > Maybe it's my gcc 3.2.2 compiler... I don't know... > Anyway, the attached patch fixes it. >
Predecremet vs. postdecrement would make no difference in that context. It's very likely your compiler. What specific error are you seeing? -Sara P.S. - What's with the ZendEngine1 reference? main/streams/streams.c is only in PHP5 (and thus would be using ZendEngine2)

Cristiano Duarte

22 years ago
Sara Golemon wrote:
> Predecremet vs. postdecrement would make no difference in that context. > It's very likely your compiler. What specific error are you seeing?
The compiler is decrementing a char** pointer instead of a char* pointer.
> P.S. - What's with the ZendEngine1 reference? main/streams/streams.c is > only in PHP5 (and thus would be using ZendEngine2)
I don't know why the ZendEngine1 is appearing at the top of my patch file. I'm using PHP5 with ZendEngine2 and I just run "cvs -d :pserver:cvsread@cvs.php.net:/repository diff php-src"... I think it's just cosmetic... Andi has pointed out that (*path_for_open)++ will make it. Best Regards, Cristiano Duarte

Andi Gutmans

22 years ago
At 10:40 PM 11/22/2003 -0200, Cristiano Duarte wrote:
>Hi all, > >The current implementation of file:// support under main/streams/strems.c >has a little bug. >Maybe it's my gcc 3.2.2 compiler... I don't know... >Anyway, the attached patch fixes it. > >Best Regards, > >Cristiano Duarte > > >? php-src/ZendEngine1 >Index: php-src/main/streams/streams.c >=================================================================== >RCS file: /repository/php-src/main/streams/streams.c,v >retrieving revision 1.39 >diff -u -r1.39 streams.c >--- php-src/main/streams/streams.c 3 Nov 2003 14:12:46 -0000 1.39 >+++ php-src/main/streams/streams.c 23 Nov 2003 00:31:08 -0000 >@@ -1433,9 +1433,9 @@ > #ifdef PHP_WIN32 > if (*(*path_for_open + 1) != ':') > #endif >- *path_for_open--; >+ --*path_for_open; > } >- >+
This should be changed to (*path_for_open)++ Andi

Cristiano Duarte

22 years ago
Andi Gutmans wrote:
> This should be changed to (*path_for_open)++
In fact, it's "(*path_for_open)--" :-) Cristiano Duarte

Andi Gutmans

22 years ago
:) At 12:34 PM 11/23/2003 -0200, Cristiano Duarte wrote: