aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/emacs.c14
2 files changed, 13 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8186e220d7d..2191cb5064e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12013-11-02 Paul Eggert <eggert@cs.ucla.edu>
2
3 * emacs.c (original_pwd): Remove global var by making it local.
4 (init_cmdargs): New arg ORIGINAL_PWD; caller changed.
5
12013-11-01 Jan Djärv <jan.h.d@swipnet.se> 62013-11-01 Jan Djärv <jan.h.d@swipnet.se>
2 7
3 * xfaces.c: Declare color_distance. 8 * xfaces.c: Declare color_distance.
diff --git a/src/emacs.c b/src/emacs.c
index 92b52f1cea6..ed93067d1fd 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -202,9 +202,6 @@ static char *daemon_name;
202 startup. */ 202 startup. */
203int daemon_pipe[2]; 203int daemon_pipe[2];
204 204
205/* If we use --chdir, this records the original directory. */
206char *original_pwd;
207
208/* Save argv and argc. */ 205/* Save argv and argc. */
209char **initial_argv; 206char **initial_argv;
210int initial_argc; 207int initial_argc;
@@ -386,7 +383,7 @@ terminate_due_to_signal (int sig, int backtrace_limit)
386/* Code for dealing with Lisp access to the Unix command line. */ 383/* Code for dealing with Lisp access to the Unix command line. */
387 384
388static void 385static void
389init_cmdargs (int argc, char **argv, int skip_args) 386init_cmdargs (int argc, char **argv, int skip_args, char *original_pwd)
390{ 387{
391 register int i; 388 register int i;
392 Lisp_Object name, dir, handler; 389 Lisp_Object name, dir, handler;
@@ -705,6 +702,9 @@ main (int argc, char **argv)
705#endif 702#endif
706 char *ch_to_dir; 703 char *ch_to_dir;
707 704
705 /* If we use --chdir, this records the original directory. */
706 char *original_pwd = 0;
707
708#if GC_MARK_STACK 708#if GC_MARK_STACK
709 stack_base = &dummy; 709 stack_base = &dummy;
710#endif 710#endif
@@ -794,7 +794,7 @@ main (int argc, char **argv)
794 if (argmatch (argv, argc, "-chdir", "--chdir", 4, &ch_to_dir, &skip_args)) 794 if (argmatch (argv, argc, "-chdir", "--chdir", 4, &ch_to_dir, &skip_args))
795 { 795 {
796 original_pwd = get_current_dir_name (); 796 original_pwd = get_current_dir_name ();
797 if (chdir (ch_to_dir) == -1) 797 if (chdir (ch_to_dir) != 0)
798 { 798 {
799 fprintf (stderr, "%s: Can't chdir to %s: %s\n", 799 fprintf (stderr, "%s: Can't chdir to %s: %s\n",
800 argv[0], ch_to_dir, strerror (errno)); 800 argv[0], ch_to_dir, strerror (errno));
@@ -1330,7 +1330,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1330 init_buffer (); /* Init default directory of main buffer. */ 1330 init_buffer (); /* Init default directory of main buffer. */
1331 1331
1332 init_callproc_1 (); /* Must precede init_cmdargs and init_sys_modes. */ 1332 init_callproc_1 (); /* Must precede init_cmdargs and init_sys_modes. */
1333 init_cmdargs (argc, argv, skip_args); /* Must precede init_lread. */ 1333
1334 /* Must precede init_lread. */
1335 init_cmdargs (argc, argv, skip_args, original_pwd);
1334 1336
1335 if (initialized) 1337 if (initialized)
1336 { 1338 {