Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
08f55805
Commit
08f55805
authored
Oct 31, 2014
by
Jan Djärv
Browse files
* emacs.c (main): Don't chdir to $HOME on Cocoa if --chdir was given.
Fixes: debbugs:18846
parent
eeeaca5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/ChangeLog
src/ChangeLog
+5
-0
src/emacs.c
src/emacs.c
+4
-4
No files found.
src/ChangeLog
View file @
08f55805
2014-10-31 Jan Djärv <jan.h.d@swipnet.se>
* emacs.c (main): Don't chdir to $HOME on Cocoa if --chdir
was given (Bug#18846).
2014-10-30 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.h (ns_set_doc_edited): Declare taking no args.
...
...
src/emacs.c
View file @
08f55805
...
...
@@ -716,7 +716,7 @@ main (int argc, char **argv)
#ifdef DAEMON_MUST_EXEC
char
dname_arg2
[
80
];
#endif
char
*
ch_to_dir
;
char
*
ch_to_dir
=
0
;
/* If we use --chdir, this records the original directory. */
char
*
original_pwd
=
0
;
...
...
@@ -1240,19 +1240,19 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
/* Started from GUI? */
/* FIXME: Do the right thing if getenv returns NULL, or if
chdir fails. */
if
(
!
inhibit_window_system
&&
!
isatty
(
0
))
if
(
!
inhibit_window_system
&&
!
isatty
(
0
)
&&
!
ch_to_dir
)
chdir
(
getenv
(
"HOME"
));
if
(
skip_args
<
argc
)
{
if
(
!
strncmp
(
argv
[
skip_args
],
"-psn"
,
4
))
{
skip_args
+=
1
;
chdir
(
getenv
(
"HOME"
));
if
(
!
ch_to_dir
)
chdir
(
getenv
(
"HOME"
));
}
else
if
(
skip_args
+
1
<
argc
&&
!
strncmp
(
argv
[
skip_args
+
1
],
"-psn"
,
4
))
{
skip_args
+=
2
;
chdir
(
getenv
(
"HOME"
));
if
(
!
ch_to_dir
)
chdir
(
getenv
(
"HOME"
));
}
}
#endif
/* COCOA */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment