summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-05-08 22:46:51 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-05-08 22:46:51 +0000
commita5ab0532caf9a11f20eeb49b78ddc8e90f64a418 (patch)
tree342738b8653ea2833844035a0a6956e335a044a8 /apps
parente40b7abeed32f51f57e4578254aa1559762a8ea2 (diff)
Various Win32 fixes. Win95 doesn't support MoveFileEx() (which was used for a
Win32 version of rename() ). There isn't a precise rename() equivalent under Win95: the standard rename() complains if the destination already exists so replaced with a combination of unlink() and MoveFile().
Diffstat (limited to 'apps')
-rw-r--r--apps/apps.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/apps.c b/apps/apps.c
index d3d601d9ed..f9cc27052b 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -218,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