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;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php