cvs: php4 /ext/standard file.c
| From: | Ilia Alshanetsky | Date: | Sat, 31 May 2003 00:32:45 +0000 |
| Subject: | cvs: php4 /ext/standard file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-21400@lists.php.net to get a copy of this message | ||
iliaa Fri May 30 20:32:45 2003 EDT
Modified files:
/php4/ext/standard file.c
Log:
Fixed bug #23913 (make rename() work across partitions on *nix)
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.343 php4/ext/standard/file.c:1.344
--- php4/ext/standard/file.c:1.343 Wed May 21 17:36:51 2003
+++ php4/ext/standard/file.c Fri May 30 20:32:45 2003
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.343 2003/05/21 21:36:51 pollita Exp $ */
+/* $Id: file.c,v 1.344 2003/05/31 00:32:45 iliaa Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -1391,6 +1391,14 @@
ret = VCWD_RENAME(old_name, new_name);
if (ret == -1) {
+#ifdef EXDEV
+ if (errno == EXDEV) {
+ if (php_copy_file(old_name, new_name TSRMLS_CC) == SUCCESS) {
+ VCWD_UNLINK(old_name);
+ RETURN_TRUE;
+ }
+ }
+#endif
php_error_docref2(NULL TSRMLS_CC, old_name, new_name, E_WARNING, "%s",
strerror(errno));
RETURN_FALSE;
}