iliaa Mon Nov 12 18:44:18 2007 UTC
Modified files: (Branch: PHP_5_3)
/php-src/main/streams plain_wrapper.c
/php-src/ext/standard file.c
Log:
Fixed bug #43182 (file_put_contents() LOCK_EX does not work properly on file
truncation).
Hi Ilia,
+ char mode[3] = wb;
+ if (flags PHP_FILE_APPEND) {
+ mode[0] = 'a';
+ } else if (flags LOCK_EX) {
+ mode[0] = 'c';
uhm, I think this assignment isn't needed, as the variable should already
contain the '\0' from the initilization above.
+ mode[2] = '\0';
probably you meant