comparison src/callproc.c @ 384:bbff43aa5eb7 r21-2-7

Import from CVS: tag r21-2-7
author cvs
date Mon, 13 Aug 2007 11:08:24 +0200
parents 8626e4521993
children 4af0ddfb7c5b
comparison
equal deleted inserted replaced
383:6a50c6a581a5 384:bbff43aa5eb7
821 821
822 void 822 void
823 init_callproc (void) 823 init_callproc (void)
824 { 824 {
825 /* This function can GC */ 825 /* This function can GC */
826 REGISTER char *sh; 826
827
828 Vprocess_environment = Qnil;
829 /* jwz: always initialize Vprocess_environment, so that egetenv() works
830 in temacs. */
831 { 827 {
828 /* jwz: always initialize Vprocess_environment, so that egetenv()
829 works in temacs. */
832 char **envp; 830 char **envp;
831 Vprocess_environment = Qnil;
833 for (envp = environ; envp && *envp; envp++) 832 for (envp = environ; envp && *envp; envp++)
834 { 833 {
835 Vprocess_environment = Fcons (build_ext_string (*envp, FORMAT_OS), 834 Vprocess_environment = Fcons (build_ext_string (*envp, FORMAT_OS),
836 Vprocess_environment); 835 Vprocess_environment);
837 } 836 }
838 } 837 }
839 838
839 {
840 /* Initialize shell-file-name from environment variables or best guess. */
840 #ifdef WINDOWSNT 841 #ifdef WINDOWSNT
841 /* Sync with FSF Emacs 19.34.6 note: this is not in 19.34.6. --marcpa */ 842 CONST char *shell = egetenv ("COMSPEC");
842 /* 843 if (!shell) shell = "\\WINNT\\system32\\cmd.exe";
843 ** If NT then we look at COMSPEC for the shell program.
844 */
845 sh = egetenv ("COMSPEC");
846 /*
847 ** If COMSPEC has been set, then convert the
848 ** DOS formatted name into a UNIX format. Then
849 ** create a LISP object.
850 */
851 if (sh)
852 Vshell_file_name = build_string (sh);
853 /*
854 ** Odd, no COMSPEC, so let's default to our
855 ** best guess for NT.
856 */
857 else
858 Vshell_file_name = build_string ("\\WINNT\\system32\\cmd.exe");
859
860 #else /* not WINDOWSNT */ 844 #else /* not WINDOWSNT */
861 845 CONST char *shell = egetenv ("SHELL");
862 sh = (char *) egetenv ("SHELL"); 846 if (!shell) shell = "/bin/sh";
863 Vshell_file_name = build_string (sh ? sh : "/bin/sh");
864
865 #endif 847 #endif
848
849 Vshell_file_name = build_string (shell);
850 }
866 } 851 }
867 852
868 #if 0 853 #if 0
869 void 854 void
870 set_process_environment (void) 855 set_process_environment (void)