summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1998-10-28 18:01:05 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1998-10-28 18:01:05 +0000
commit53d09b49e1ebead0af49d6096bf3b026fbd241e9 (patch)
treeab7ff3106f521b1387a03670eefe712538a213b4
parent474eb2cd70817293267bde536139b95c4e1bf135 (diff)
mkdtemp a directory where Lynx puts all it's temporary files.
Fixing creation of all temp files would involve rewriting Lynx.
-rw-r--r--gnu/usr.bin/lynx/src/LYClean.c4
-rw-r--r--gnu/usr.bin/lynx/src/LYMain.c2
2 files changed, 6 insertions, 0 deletions
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] != '/') {