aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 288ddb47bd7..8e52da75926 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1643,23 +1643,27 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1643 { 1643 {
1644#ifdef NS_IMPL_COCOA 1644#ifdef NS_IMPL_COCOA
1645 /* Started from GUI? */ 1645 /* Started from GUI? */
1646 /* FIXME: Do the right thing if get_homedir returns "", or if 1646 bool go_home = (!ch_to_dir && !inhibit_window_system
1647 chdir fails. */ 1647 && !isatty (STDIN_FILENO));
1648 if (! inhibit_window_system && ! isatty (STDIN_FILENO) && ! ch_to_dir)
1649 chdir (get_homedir ());
1650 if (skip_args < argc) 1648 if (skip_args < argc)
1651 { 1649 {
1652 if (!strncmp (argv[skip_args], "-psn", 4)) 1650 if (!strncmp (argv[skip_args], "-psn", 4))
1653 { 1651 {
1654 skip_args += 1; 1652 skip_args += 1;
1655 if (! ch_to_dir) chdir (get_homedir ()); 1653 go_home |= !ch_to_dir;
1656 } 1654 }
1657 else if (skip_args+1 < argc && !strncmp (argv[skip_args+1], "-psn", 4)) 1655 else if (skip_args+1 < argc && !strncmp (argv[skip_args+1], "-psn", 4))
1658 { 1656 {
1659 skip_args += 2; 1657 skip_args += 2;
1660 if (! ch_to_dir) chdir (get_homedir ()); 1658 go_home |= !ch_to_dir;
1661 } 1659 }
1662 } 1660 }
1661 if (go_home)
1662 {
1663 char const *home = get_homedir ();
1664 if (*home && chdir (home) == 0)
1665 emacs_wd = emacs_get_current_dir_name ();
1666 }
1663#endif /* COCOA */ 1667#endif /* COCOA */
1664 } 1668 }
1665#endif /* HAVE_NS */ 1669#endif /* HAVE_NS */