Various Win32 fixes. Win95 doesn't support MoveFileEx() (which was used for a
[openssl.git] / apps / apps.c
index ba07016e8315195d77591e846e34a82d437055a5..f9cc27052b58b46f1737a8bb6480862b15eaa059 100644 (file)
 #  include "bss_file.c"
 #endif
 
-#ifndef NOPROTO
 int app_init(long mesgwin);
-#else
-int app_init();
-#endif
-
 #ifdef undef /* never finished - probably never will be :-) */
 int args_from_file(char *file, int *argc, char **argv[])
        {
@@ -223,10 +218,16 @@ void program_name(char *in, char *out, int size)
 #ifdef WIN32
 int WIN32_rename(char *from, char *to)
        {
+#ifdef WINNT
        int ret;
+/* Note: MoveFileEx() doesn't work under Win95, Win98 */
 
        ret=MoveFileEx(from,to,MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED);
        return(ret?0:-1);
+#else
+        unlink(to);
+        return MoveFile(from, to);
+#endif
        }
 #endif