]> pd.if.org Git - pdclib/blobdiff - platform/win32/functions/_PDCLIB/_PDCLIB_rename.c
PDCLib includes with quotes, not <>.
[pdclib] / platform / win32 / functions / _PDCLIB / _PDCLIB_rename.c
index a65715dfc4f9dd591b43e0dd5e380024cdf92bfb..e068b215ea3caae41280143a9ac173fc681c5212 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* _PDCLIB_rename( const char *, const char * )
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -9,18 +7,25 @@
 #include <stdio.h>
 
 #ifndef REGTEST
-#include <_PDCLIB_glue.h>
+#include "_PDCLIB_glue.h"
 #include <errno.h>
+#include <windows.h>
 
+void _PDCLIB_w32errno( void );
 int _PDCLIB_rename( const char * old, const char * new )
 {
-    errno = ENOTSUP;
+
+    BOOL ok = MoveFile(old, new);
+    if(!ok) {
+        _PDCLIB_w32errno();
+    }
+    return !ok;
 }
 
 #endif
 
 #ifdef TEST
-#include <_PDCLIB_test.h>
+#include "_PDCLIB_test.h"
 
 #include <stdlib.h>