emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111757: Minor getenv-related fixes.


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111757: Minor getenv-related fixes.
Date: Tue, 12 Feb 2013 18:10:36 -0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111757
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2013-02-12 18:10:36 -0800
message:
  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.
modified:
  src/ChangeLog
  src/callproc.c
  src/dispnew.c
  src/sysdep.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-02-13 00:50:38 +0000
+++ b/src/ChangeLog     2013-02-13 02:10:36 +0000
@@ -1,3 +1,13 @@
+2013-02-13  Paul Eggert  <address@hidden>
+
+       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  <address@hidden>
 
        * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):

=== modified file 'src/callproc.c'
--- a/src/callproc.c    2013-02-09 16:36:53 +0000
+++ b/src/callproc.c    2013-02-13 02:10:36 +0000
@@ -997,13 +997,11 @@
     tmpdir = Vtemporary_file_directory;
   else
     {
-#ifndef DOS_NT
-      if (getenv ("TMPDIR"))
-       tmpdir = build_string (getenv ("TMPDIR"));
-      else
-       tmpdir = build_string ("/tmp/");
-#else /* DOS_NT */
       char *outf;
+#ifndef DOS_NT
+      outf = getenv ("TMPDIR");
+      tmpdir = build_string (outf ? outf : "/tmp/");
+#else /* DOS_NT */
       if ((outf = egetenv ("TMPDIR"))
          || (outf = egetenv ("TMP"))
          || (outf = egetenv ("TEMP")))
@@ -1655,7 +1653,7 @@
   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

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2013-01-28 05:47:51 +0000
+++ b/src/dispnew.c     2013-02-13 02:10:36 +0000
@@ -6014,7 +6014,6 @@
 
   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.  */
@@ -6109,8 +6108,7 @@
 #ifdef WINDOWSNT
   terminal_type = "w32console";
 #else
-  /* Look at the TERM variable.  */
-  terminal_type = (char *) getenv ("TERM");
+  terminal_type = getenv ("TERM");
 #endif
   if (!terminal_type)
     {

=== modified file 'src/sysdep.c'
--- a/src/sysdep.c      2013-02-01 06:30:51 +0000
+++ b/src/sysdep.c      2013-02-13 02:10:36 +0000
@@ -527,10 +527,10 @@
 #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";
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]