+2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ Minor getenv-related fixes.
+ * callproc.c (Fcall_process_region) [!DOS_NT]:
+ Avoid unnecessary duplicate call to getenv.
+ * callproc.c (init_callproc):
+ * dispnew.c (init_display):
+ * sysdep.c (sys_subshell):
+ Omit unnecessary cast of getenv or egetenv.
+
2013-02-13 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
tmpdir = Vtemporary_file_directory;
else
{
+ char *outf;
#ifndef DOS_NT
- if (getenv ("TMPDIR"))
- tmpdir = build_string (getenv ("TMPDIR"));
- else
- tmpdir = build_string ("/tmp/");
+ outf = getenv ("TMPDIR");
+ tmpdir = build_string (outf ? outf : "/tmp/");
#else /* DOS_NT */
- char *outf;
if ((outf = egetenv ("TMPDIR"))
|| (outf = egetenv ("TMP"))
|| (outf = egetenv ("TEMP")))
if (! file_accessible_directory_p (SSDATA (tempdir)))
dir_warning ("arch-independent data dir", Vdata_directory);
- sh = (char *) getenv ("SHELL");
+ sh = getenv ("SHELL");
Vshell_file_name = build_string (sh ? sh : "/bin/sh");
#ifdef DOS_NT
inverse_video = 0;
cursor_in_echo_area = 0;
- terminal_type = (char *) 0;
/* Now is the time to initialize this; it's used by init_sys_modes
during startup. */
#ifdef WINDOWSNT
terminal_type = "w32console";
#else
- /* Look at the TERM variable. */
- terminal_type = (char *) getenv ("TERM");
+ terminal_type = getenv ("TERM");
#endif
if (!terminal_type)
{
#ifdef DOS_NT /* MW, Aug 1993 */
getcwd (oldwd, sizeof oldwd);
if (sh == 0)
- sh = (char *) egetenv ("SUSPEND"); /* KFS, 1994-12-14 */
+ sh = egetenv ("SUSPEND"); /* KFS, 1994-12-14 */
#endif
if (sh == 0)
- sh = (char *) egetenv ("SHELL");
+ sh = egetenv ("SHELL");
if (sh == 0)
sh = "sh";