Patch: MoveFileEx()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patch: MoveFileEx.diff
Martin Wilck <Martin.Wilck@fujitsu-siemens.com>
Patch against: CVS 2002-09-13

Modified files:
        - wine/files:        file.c

MoveFileEx(): Fix behaviour with files on different drives.
        - delete source if copy successful
        - return correct error code if MOVEFILE_COPY_ALLOWED is not set.

Index: files/file.c
===================================================================
RCS file: /home/wine/wine/files/file.c,v
retrieving revision 1.160
diff -u -r1.160 file.c
--- files/file.c	12 Sep 2002 22:28:01 -0000	1.160
+++ files/file.c	13 Sep 2002 12:26:36 -0000
@@ -2675,11 +2675,13 @@
             /* use copy, if allowed */
             if (!(flag & MOVEFILE_COPY_ALLOWED))
             {
-                /* FIXME: Use right error code */
-                SetLastError( ERROR_FILE_EXISTS );
+                SetLastError( ERROR_NOT_SAME_DEVICE );
                 return FALSE;
             }
-            return CopyFileW( fn1, fn2, !(flag & MOVEFILE_REPLACE_EXISTING) );
+            if ( CopyFileW( fn1, fn2, !(flag & MOVEFILE_REPLACE_EXISTING) ) )
+                return DeleteFileW ( fn1 );
+            else
+                return FALSE;
         }
         if (rename( full_name1.long_name, full_name2.long_name ) == -1)
 	{
-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1	    mailto:Martin.Wilck@Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy







[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux