Commit 83be8524 authored by Paul Eggert's avatar Paul Eggert
Browse files

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.
parent d6596b94
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> 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
   
* makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)): * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
......
...@@ -997,13 +997,11 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r ...@@ -997,13 +997,11 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
tmpdir = Vtemporary_file_directory; tmpdir = Vtemporary_file_directory;
else else
{ {
char *outf;
#ifndef DOS_NT #ifndef DOS_NT
if (getenv ("TMPDIR")) outf = getenv ("TMPDIR");
tmpdir = build_string (getenv ("TMPDIR")); tmpdir = build_string (outf ? outf : "/tmp/");
else
tmpdir = build_string ("/tmp/");
#else /* DOS_NT */ #else /* DOS_NT */
char *outf;
if ((outf = egetenv ("TMPDIR")) if ((outf = egetenv ("TMPDIR"))
|| (outf = egetenv ("TMP")) || (outf = egetenv ("TMP"))
|| (outf = egetenv ("TEMP"))) || (outf = egetenv ("TEMP")))
...@@ -1655,7 +1653,7 @@ init_callproc (void) ...@@ -1655,7 +1653,7 @@ init_callproc (void)
if (! file_accessible_directory_p (SSDATA (tempdir))) if (! file_accessible_directory_p (SSDATA (tempdir)))
dir_warning ("arch-independent data dir", Vdata_directory); dir_warning ("arch-independent data dir", Vdata_directory);
sh = (char *) getenv ("SHELL"); sh = getenv ("SHELL");
Vshell_file_name = build_string (sh ? sh : "/bin/sh"); Vshell_file_name = build_string (sh ? sh : "/bin/sh");
#ifdef DOS_NT #ifdef DOS_NT
......
...@@ -6014,7 +6014,6 @@ init_display (void) ...@@ -6014,7 +6014,6 @@ init_display (void)
inverse_video = 0; inverse_video = 0;
cursor_in_echo_area = 0; cursor_in_echo_area = 0;
terminal_type = (char *) 0;
/* Now is the time to initialize this; it's used by init_sys_modes /* Now is the time to initialize this; it's used by init_sys_modes
during startup. */ during startup. */
...@@ -6109,8 +6108,7 @@ init_display (void) ...@@ -6109,8 +6108,7 @@ init_display (void)
#ifdef WINDOWSNT #ifdef WINDOWSNT
terminal_type = "w32console"; terminal_type = "w32console";
#else #else
/* Look at the TERM variable. */ terminal_type = getenv ("TERM");
terminal_type = (char *) getenv ("TERM");
#endif #endif
if (!terminal_type) if (!terminal_type)
{ {
......
...@@ -527,10 +527,10 @@ sys_subshell (void) ...@@ -527,10 +527,10 @@ sys_subshell (void)
#ifdef DOS_NT /* MW, Aug 1993 */ #ifdef DOS_NT /* MW, Aug 1993 */
getcwd (oldwd, sizeof oldwd); getcwd (oldwd, sizeof oldwd);
if (sh == 0) if (sh == 0)
sh = (char *) egetenv ("SUSPEND"); /* KFS, 1994-12-14 */ sh = egetenv ("SUSPEND"); /* KFS, 1994-12-14 */
#endif #endif
if (sh == 0) if (sh == 0)
sh = (char *) egetenv ("SHELL"); sh = egetenv ("SHELL");
if (sh == 0) if (sh == 0)
sh = "sh"; sh = "sh";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment