diff options
| author | Paul Eggert | 2018-11-13 09:29:14 -0800 |
|---|---|---|
| committer | Paul Eggert | 2018-11-13 09:32:50 -0800 |
| commit | 900276502fbb4dcabdabc5d7d24b4bc5645f2cf3 (patch) | |
| tree | 4d6c17f5b3cea0f4d5dfbc7243eb6495269a7e56 /src/lisp.h | |
| parent | ce1fb157e840fd292c3db4632831c4514a663890 (diff) | |
| download | emacs-900276502fbb4dcabdabc5d7d24b4bc5645f2cf3.tar.gz emacs-900276502fbb4dcabdabc5d7d24b4bc5645f2cf3.zip | |
Act like POSIX sh if $HOME is relative
POSIX says sh ~/foo should act like $HOME/foo even if $HOME is
relative, so be consistent with that (Bug#33255).
* admin/merge-gnulib (GNULIB_MODULES): Add dosname.
* src/buffer.c (init_buffer): Use emacs_wd to get
initial working directory with slash appended if needed.
(default-directory): Say it must be absolute.
* src/emacs.c (emacs_wd): New global variable.
(init_cmdargs): Dir arg is now char const *.
(main): Set emacs_wd.
* src/emacs.c (main) [NS_IMPL_COCOA]:
* src/fileio.c (Fexpand_file_name):
Use get_homedir instead of egetenv ("HOME").
* src/fileio.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME.
(splice_dir_file, get_homedir): New functions.
* src/xrdb.c (gethomedir): Remove. All callers changed
to use get_homedir and splice_dir_file.
* test/src/fileio-tests.el (fileio-tests--relative-HOME): New test.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index f8ffb33a641..7e7dba631f3 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4061,6 +4061,8 @@ extern void syms_of_marker (void); | |||
| 4061 | 4061 | ||
| 4062 | /* Defined in fileio.c. */ | 4062 | /* Defined in fileio.c. */ |
| 4063 | 4063 | ||
| 4064 | extern char *splice_dir_file (char *, char const *, char const *); | ||
| 4065 | extern char const *get_homedir (void); | ||
| 4064 | extern Lisp_Object expand_and_dir_to_file (Lisp_Object); | 4066 | extern Lisp_Object expand_and_dir_to_file (Lisp_Object); |
| 4065 | extern Lisp_Object write_region (Lisp_Object, Lisp_Object, Lisp_Object, | 4067 | extern Lisp_Object write_region (Lisp_Object, Lisp_Object, Lisp_Object, |
| 4066 | Lisp_Object, Lisp_Object, Lisp_Object, | 4068 | Lisp_Object, Lisp_Object, Lisp_Object, |
| @@ -4185,6 +4187,7 @@ extern void syms_of_frame (void); | |||
| 4185 | /* Defined in emacs.c. */ | 4187 | /* Defined in emacs.c. */ |
| 4186 | extern char **initial_argv; | 4188 | extern char **initial_argv; |
| 4187 | extern int initial_argc; | 4189 | extern int initial_argc; |
| 4190 | extern char const *emacs_wd; | ||
| 4188 | #if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) | 4191 | #if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) |
| 4189 | extern bool display_arg; | 4192 | extern bool display_arg; |
| 4190 | #endif | 4193 | #endif |