(message_dolog): GCPRO the oldpoint, oldbegv and oldzv
[bpt/emacs.git] / src / w32.c
index 71ba574..da7d29b 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -1560,10 +1560,11 @@ sys_rename (const char * oldname, const char * newname)
             seems to make the second rename work properly.  */
          sprintf (p, ".%s.%u", o, i);
          i++;
+         result = rename (oldname, temp);
        }
       /* This loop must surely terminate!  */
-      while (rename (oldname, temp) < 0 && errno == EEXIST);
-      if (errno != EEXIST)
+      while (result < 0 && errno == EEXIST);
+      if (result < 0)
        return -1;
     }