aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/emacs.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 584207802b4..c516d348d84 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12014-10-31 Jan Djärv <jan.h.d@swipnet.se>
2
3 * emacs.c (main): Don't chdir to $HOME on Cocoa if --chdir
4 was given (Bug#18846).
5
12014-10-30 Jan Djärv <jan.h.d@swipnet.se> 62014-10-30 Jan Djärv <jan.h.d@swipnet.se>
2 7
3 * nsterm.h (ns_set_doc_edited): Declare taking no args. 8 * nsterm.h (ns_set_doc_edited): Declare taking no args.
diff --git a/src/emacs.c b/src/emacs.c
index fd93324de97..4c3857e698d 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -716,7 +716,7 @@ main (int argc, char **argv)
716#ifdef DAEMON_MUST_EXEC 716#ifdef DAEMON_MUST_EXEC
717 char dname_arg2[80]; 717 char dname_arg2[80];
718#endif 718#endif
719 char *ch_to_dir; 719 char *ch_to_dir = 0;
720 720
721 /* If we use --chdir, this records the original directory. */ 721 /* If we use --chdir, this records the original directory. */
722 char *original_pwd = 0; 722 char *original_pwd = 0;
@@ -1240,19 +1240,19 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1240 /* Started from GUI? */ 1240 /* Started from GUI? */
1241 /* FIXME: Do the right thing if getenv returns NULL, or if 1241 /* FIXME: Do the right thing if getenv returns NULL, or if
1242 chdir fails. */ 1242 chdir fails. */
1243 if (! inhibit_window_system && ! isatty (0)) 1243 if (! inhibit_window_system && ! isatty (0) && ! ch_to_dir)
1244 chdir (getenv ("HOME")); 1244 chdir (getenv ("HOME"));
1245 if (skip_args < argc) 1245 if (skip_args < argc)
1246 { 1246 {
1247 if (!strncmp (argv[skip_args], "-psn", 4)) 1247 if (!strncmp (argv[skip_args], "-psn", 4))
1248 { 1248 {
1249 skip_args += 1; 1249 skip_args += 1;
1250 chdir (getenv ("HOME")); 1250 if (! ch_to_dir) chdir (getenv ("HOME"));
1251 } 1251 }
1252 else if (skip_args+1 < argc && !strncmp (argv[skip_args+1], "-psn", 4)) 1252 else if (skip_args+1 < argc && !strncmp (argv[skip_args+1], "-psn", 4))
1253 { 1253 {
1254 skip_args += 2; 1254 skip_args += 2;
1255 chdir (getenv ("HOME")); 1255 if (! ch_to_dir) chdir (getenv ("HOME"));
1256 } 1256 }
1257 } 1257 }
1258#endif /* COCOA */ 1258#endif /* COCOA */