--- gv-3.5.8/src/file.c.foo 2002-09-24 17:01:07.000000000 -0400 +++ gv-3.5.8/src/file.c 2002-09-24 18:29:44.000000000 -0400 @@ -208,21 +208,13 @@ if (strlen(tmpExt)>11) tmpExt[11] = '\0'; /* allow .ps_page_nnn */ if (strlen(tmpName)+strlen(tmpExt)>23) tmpName[23-strlen(tmpExt)] = '\0'; } - { - struct stat s; - int no_such_file; - int i=1; - do { #ifdef VMS sprintf(tempFilename,"%sgv_%lx_%x_%s_%s.tmp",tmpDirBuf,time(NULL),i,tmpName,tmpExt); #else - sprintf(tempFilename,"%sgv_%lx_%x_%s.%s.tmp",tmpDirBuf,time(NULL),i,tmpName,tmpExt); + sprintf(tempFilename,"%sgv_%s.%s.XXXXXX",tmpDirBuf,tmpName,tmpExt); #endif - file_translateTildeInPath(tempFilename); - no_such_file = stat(tempFilename,&s); - i++; - } while (!no_such_file); - } + file_translateTildeInPath(tempFilename); + close(mkstemp(tempFilename)); SMESSAGE(tempFilename) tempFilenameP = GV_XtNewString(tempFilename); ENDMESSAGE(file_getTmpFilename)