aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2018-01-20 16:29:10 +0000
committerTatsuya Kinoshita <tats@debian.org>2018-01-21 01:34:11 +0000
commit18dcbadf2771cdb0c18509b14e4e73505b242753 (patch)
tree1ea6237b8f2c596d86d14f92d72716b579dfed07 /main.c
parentSuppress error messages when ~/.w3m is unwritable (diff)
downloadw3m-18dcbadf2771cdb0c18509b14e4e73505b242753.tar.gz
w3m-18dcbadf2771cdb0c18509b14e4e73505b242753.zip
Make temporary directory safely when ~/.w3m is unwritable
Diffstat (limited to '')
-rw-r--r--main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.c b/main.c
index a20b4a1..43e181c 100644
--- a/main.c
+++ b/main.c
@@ -5972,6 +5972,13 @@ w3m_exit(int i)
#ifdef __MINGW32_VERSION
WSACleanup();
#endif
+#ifdef HAVE_MKDTEMP
+ if (no_rc_dir && tmp_dir != rc_dir)
+ if (rmdir(tmp_dir) != 0) {
+ fprintf(stderr, "Can't remove temporary directory (%s)!\n", tmp_dir);
+ exit(1);
+ }
+#endif
exit(i);
}