From 53d09b49e1ebead0af49d6096bf3b026fbd241e9 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Wed, 28 Oct 1998 18:01:05 +0000 Subject: mkdtemp a directory where Lynx puts all it's temporary files. Fixing creation of all temp files would involve rewriting Lynx. --- gnu/usr.bin/lynx/src/LYClean.c | 4 ++++ gnu/usr.bin/lynx/src/LYMain.c | 2 ++ 2 files changed, 6 insertions(+) (limited to 'gnu') diff --git a/gnu/usr.bin/lynx/src/LYClean.c b/gnu/usr.bin/lynx/src/LYClean.c index 424560e6708..47a0700d9bc 100644 --- a/gnu/usr.bin/lynx/src/LYClean.c +++ b/gnu/usr.bin/lynx/src/LYClean.c @@ -142,6 +142,10 @@ PUBLIC void cleanup_files NOARGS char filename[256]; tempname(filename, REMOVE_FILES); + + if (rmdir(lynx_temp_space)) + perror("Could not remove the temp-directory"); + FREE(lynx_temp_space); } diff --git a/gnu/usr.bin/lynx/src/LYMain.c b/gnu/usr.bin/lynx/src/LYMain.c index 2e600b1e325..ea59f4df0eb 100644 --- a/gnu/usr.bin/lynx/src/LYMain.c +++ b/gnu/usr.bin/lynx/src/LYMain.c @@ -742,6 +742,8 @@ else {init_ctrl_break[0] = 1;} StrAllocCat(lynx_temp_space, ":"); } #else + StrAllocCat(lynx_temp_space, "/lynx-XXXXXX"); + lynx_temp_space = mkdtemp(lynx_temp_space); #ifndef __DJGPP__ if (((len = strlen(lynx_temp_space)) > 1) && lynx_temp_space[len-1] != '/') { -- cgit v1.2.3