File tree 6 files changed +16
-2
lines changed
6 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ typedef long clen_t;
210210#define HAVE_SRANDOM
211211#undef HAVE_GETPASSPHRASE
212212#define HAVE_CHDIR
213+ #define HAVE_MKDTEMP
213214
214215
215216#define SETJMP(env) sigsetjmp(env,1)
Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ typedef long clen_t;
143143#undef HAVE_SRANDOM
144144#undef HAVE_GETPASSPHRASE
145145#undef HAVE_CHDIR
146+ #undef HAVE_MKDTEMP
146147#undef HAVE_SETPGRP
147148#undef HAVE_SETLOCALE
148149#undef HAVE_LANGINFO_CODESET
Original file line number Diff line number Diff line change @@ -8767,7 +8767,7 @@ _ACEOF
87678767
87688768
87698769
8770- for ac_func in strcasecmp strcasestr strchr memcpy strerror bcopy setpgrp chdir getcwd getwd readlink setenv putenv strtoll stroq atoll atoq symlink readlink lstat srand48 srandom getpassphrase waitpid setlocale
8770+ for ac_func in strcasecmp strcasestr strchr memcpy strerror bcopy setpgrp chdir mkdtemp getcwd getwd readlink setenv putenv strtoll stroq atoll atoq symlink readlink lstat srand48 srandom getpassphrase waitpid setlocale
87718771do :
87728772 as_ac_var=` $as_echo " ac_cv_func_$ac_func " | $as_tr_sh `
87738773ac_fn_c_check_func " $LINENO " " $ac_func " " $as_ac_var "
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ dnl AC_FUNC_MEMCMP
150150dnl AC_FUNC_MMAP
151151dnl AC_FUNC_SETVBUF_REVERSED
152152dnl AC_FUNC_VPRINTF
153- AC_CHECK_FUNCS ( strcasecmp strcasestr strchr memcpy strerror bcopy setpgrp chdir getcwd getwd readlink setenv putenv strtoll stroq atoll atoq symlink readlink lstat srand48 srandom getpassphrase waitpid setlocale )
153+ AC_CHECK_FUNCS ( strcasecmp strcasestr strchr memcpy strerror bcopy setpgrp chdir mkdtemp getcwd getwd readlink setenv putenv strtoll stroq atoll atoq symlink readlink lstat srand48 srandom getpassphrase waitpid setlocale )
154154AC_FUNC_STRFTIME
155155AC_FUNC_WAIT3
156156AC_FUNC_SETPGRP
Original file line number Diff line number Diff line change @@ -5971,6 +5971,13 @@ w3m_exit(int i)
59715971#endif
59725972#ifdef __MINGW32_VERSION
59735973 WSACleanup ();
5974+ #endif
5975+ #ifdef HAVE_MKDTEMP
5976+ if (no_rc_dir && tmp_dir != rc_dir )
5977+ if (rmdir (tmp_dir ) != 0 ) {
5978+ fprintf (stderr , "Can't remove temporary directory (%s)!\n" , tmp_dir );
5979+ exit (1 );
5980+ }
59745981#endif
59755982 exit (i );
59765983}
Original file line number Diff line number Diff line change @@ -1330,6 +1330,11 @@ init_rc(void)
13301330 ((tmp_dir = getenv ("TMP" )) == NULL || * tmp_dir == '\0' ) &&
13311331 ((tmp_dir = getenv ("TEMP" )) == NULL || * tmp_dir == '\0' ))
13321332 tmp_dir = "/tmp" ;
1333+ #ifdef HAVE_MKDTEMP
1334+ tmp_dir = mkdtemp (Strnew_m_charp (tmp_dir , "/w3m-XXXXXX" , NULL )-> ptr );
1335+ if (tmp_dir == NULL )
1336+ tmp_dir = rc_dir ;
1337+ #endif
13331338 create_option_search_table ();
13341339 goto open_rc ;
13351340}
You can’t perform that action at this time.
0 commit comments