Jerry James b08b3a
--- ./o/unixfsys.c.orig	2014-09-06 09:45:30.000000000 -0600
Jerry James b08b3a
+++ ./o/unixfsys.c	2014-09-06 20:00:00.000000000 -0600
Jerry James a8bc9e
@@ -411,11 +411,17 @@ FILE *
e6a250
 backup_fopen(char *filename, char *option)
e6a250
 {
e6a250
 	char backupfilename[MAXPATHLEN];
7fc6c8
-	char command[MAXPATHLEN * 2];
e6a250
+#ifndef HAVE_RENAME
7fc6c8
+	char command[MAXPATHLEN * 2 + 4];
e6a250
+#endif
e6a250
 
e6a250
 	strcat(strcpy(backupfilename, filename), ".BAK");
e6a250
+#ifdef HAVE_RENAME
e6a250
+	rename(filename, backupfilename);
e6a250
+#else
e6a250
 	sprintf(command, "mv %s %s", filename, backupfilename);
7fc6c8
 	msystem(command);
e6a250
+#endif
e6a250
 	return(fopen(filename, option));
e6a250
 }
e6a250
 
Jerry James a8bc9e
@@ -440,6 +446,9 @@ LFD(Lrename_file)(void)
e6a250
 {
e6a250
 	char filename[MAXPATHLEN];
e6a250
 	char newfilename[MAXPATHLEN];
e6a250
+#ifndef HAVE_RENAME
7fc6c8
+	char command[MAXPATHLEN * 2 + 4];
e6a250
+#endif
e6a250
 
e6a250
 	check_arg(2);
e6a250
 	check_type_or_pathname_string_symbol_stream(&vs_base[0]);