%%% Created Wed Apr 10 09:53:30 MDT 2002 by target lynx.patch. %%% diff -ru orig/lynx2-8-5/WWW/Library/Implementation/HTUtils.h lynx2-8-5/WWW/Library/Implementation/HTUtils.h --- orig/lynx2-8-5/WWW/Library/Implementation/HTUtils.h Tue Jan 1 18:30:08 2002 +++ lynx2-8-5/WWW/Library/Implementation/HTUtils.h Wed Apr 10 09:52:30 2002 @@ -14,6 +14,9 @@ #ifdef HAVE_CONFIG_H #include /* generated by autoconf 'configure' script */ +#if defined(__APPLE__) +#undef HAVE_MKSTEMP /* not unique enough on OS X. */ +#endif /* __APPLE__ */ #include #include diff -ru orig/lynx2-8-5/src/LYUtils.c lynx2-8-5/src/LYUtils.c --- orig/lynx2-8-5/src/LYUtils.c Tue Jan 1 18:30:08 2002 +++ lynx2-8-5/src/LYUtils.c Wed Apr 10 08:19:58 2002 @@ -3146,10 +3146,15 @@ if (strlen(interim) + strlen(suffix) < LY_MAXPATH - 2 && (fd = mkstemp(interim)) >= 0) { sprintf(result, "%s%s", interim, suffix); - rename(interim, result); - chmod(result, HIDE_CHMOD); /* (yes, some mkstemps are broken ;-) */ +/* FIXME: rename may obliterate an existing file! */ + if (LYCanReadFile(result)) { + code = FALSE; + } else { + rename(interim, result); + chmod(result, HIDE_CHMOD); /* (yes, some mkstemps are broken ;-) */ + code = TRUE; + } close(fd); - code = TRUE; } else { code = FALSE; }