iliaa           Fri May 30 20:33:06 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php4/ext/standard  file.c 
  Log:
  MFH: Fixed bug #23913 (make rename() work across partitions on *nix)
  
  
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.279.2.23 php4/ext/standard/file.c:1.279.2.24
--- php4/ext/standard/file.c:1.279.2.23 Mon May 26 15:01:45 2003
+++ php4/ext/standard/file.c    Fri May 30 20:33:06 2003
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: file.c,v 1.279.2.23 2003/05/26 19:01:45 wez Exp $ */
+/* $Id: file.c,v 1.279.2.24 2003/05/31 00:33:06 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1867,6 +1867,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

Reply via email to