fix mktemp

This commit is contained in:
jasoni 1998-11-24 04:02:12 +00:00
parent a1198e326d
commit a220cc70c0
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,20 @@
--- fileio.c.orig Mon Nov 23 21:19:30 1998
+++ fileio.c Mon Nov 23 21:19:53 1998
@@ -2610,7 +2610,7 @@
STRCAT(itmp, TEMPNAME);
if ((p = vim_strchr(itmp, '?')) != NULL)
*p = extra_char;
- if (*mktemp((char *)itmp) == NUL)
+ if (mkstemp((char *)itmp) == NUL)
continue;
return vim_strsave(itmp);
}
@@ -2646,7 +2646,7 @@
STRCPY(itmp, TEMPNAME);
if ((p = vim_strchr(itmp, '?')) != NULL)
*p = extra_char;
- if (*mktemp((char *)itmp) == NUL)
+ if (mkstemp((char *)itmp) == NUL)
# endif
# endif
# endif

View File

@ -0,0 +1,29 @@
--- ctags/main.c.orig Mon Nov 23 21:50:56 1998
+++ ctags/main.c Mon Nov 23 21:51:31 1998
@@ -684,7 +684,7 @@
*/
if (toStdout)
{
- TagFile.name = tmpnam(tempName);
+ TagFile.name = mkstemp(tempName);
TagFile.fp = fopen(TagFile.name, "w");
}
else
@@ -779,7 +779,7 @@
char tempName[L_tmpnam];
int result = -1;
- if (tmpnam(tempName) != NULL)
+ if (mkstemp(tempName) != NULL)
{
result = copyFile(name, tempName, size);
if (result == 0)
@@ -834,7 +834,7 @@
static void beginEtagsFile()
{
- tmpnam(TagFile.etags.name);
+ mkstemp(TagFile.etags.name);
TagFile.etags.fp = fopen(TagFile.etags.name, "w+b");
if (TagFile.etags.fp == NULL)
error(FATAL | PERROR, "cannot open \"%s\"", TagFile.etags.name);