openbsd-ports/textproc/wdiff/patches/patch-ac
1998-05-17 04:51:34 +00:00

41 lines
1.4 KiB
Plaintext

*** wdiff.c.orig Sun Nov 6 02:57:23 1994
--- wdiff.c Sun May 17 00:48:07 1998
***************
*** 566,573 ****
this temporary local file. Once done, prepare it for reading.
We do not need the file name itself anymore. */
! tmpnam (side->temp_name);
! side->file = fopen (side->temp_name, "w+");
if (side->file == NULL)
error (EXIT_OTHER_REASON, errno, side->temp_name);
if (unlink (side->temp_name) != 0)
--- 566,573 ----
this temporary local file. Once done, prepare it for reading.
We do not need the file name itself anymore. */
! sprintf(side->temp_name, "/tmp/wd.XXXXXXXX");
! side->file = fdopen (mkstemp(side->temp_name), "w+");
if (side->file == NULL)
error (EXIT_OTHER_REASON, errno, side->temp_name);
if (unlink (side->temp_name) != 0)
***************
*** 593,600 ****
side->character = getc (side->file);
side->position = 0;
! tmpnam (side->temp_name);
! side->temp_file = fopen (side->temp_name, "w");
if (side->temp_file == NULL)
error (EXIT_OTHER_REASON, errno, side->temp_name);
--- 593,600 ----
side->character = getc (side->file);
side->position = 0;
! sprintf(side->temp_name, "/tmp/wd.XXXXXXXX");
! side->temp_file = fdopen (mkstemp(side->temp_name), "w");
if (side->temp_file == NULL)
error (EXIT_OTHER_REASON, errno, side->temp_name);