diff options
| author | Paul Eggert | 2019-07-24 14:28:13 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-07-24 14:33:02 -0700 |
| commit | a5063aa8b174db286a0e83b8ffdd4e65c521f733 (patch) | |
| tree | dc439d78ecef638817f98cb7e43868fa2ab7b856 /doc/lispref | |
| parent | e089c3141a51bf70b91da21a01cdb4be0b63c08d (diff) | |
| download | emacs-a5063aa8b174db286a0e83b8ffdd4e65c521f733.tar.gz emacs-a5063aa8b174db286a0e83b8ffdd4e65c521f733.zip | |
Do not treat ~nosuchuser as an absolute file name
Derived from Ken Brown’s patch (Bug#36502#97).
* doc/lispref/files.texi (Relative File Names):
* etc/NEWS: Document this.
* src/fileio.c (user_homedir): New function.
(Fexpand_file_name, file_name_absolute_p): Use it.
(search_embedded_absfilename): Simplify via file_name_absolute_p.
* test/src/fileio-tests.el (fileio-tests--no-such-user): New test.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/files.texi | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 0519f787dce..0ea8a4f0a19 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -2154,7 +2154,11 @@ backslash, or with a drive specification @samp{@var{x}:/}, where | |||
| 2154 | 2154 | ||
| 2155 | @defun file-name-absolute-p filename | 2155 | @defun file-name-absolute-p filename |
| 2156 | This function returns @code{t} if file @var{filename} is an absolute | 2156 | This function returns @code{t} if file @var{filename} is an absolute |
| 2157 | file name or begins with @samp{~}, @code{nil} otherwise. | 2157 | file name, @code{nil} otherwise. A file name is considered to be |
| 2158 | absolute if its first component is @samp{~}, or is @samp{~@var{user}} | ||
| 2159 | where @var{user} is a valid login name. In the following examples, | ||
| 2160 | assume that there is a user named @samp{rms} but no user named | ||
| 2161 | @samp{nosuchuser}. | ||
| 2158 | 2162 | ||
| 2159 | @example | 2163 | @example |
| 2160 | @group | 2164 | @group |
| @@ -2162,6 +2166,10 @@ file name or begins with @samp{~}, @code{nil} otherwise. | |||
| 2162 | @result{} t | 2166 | @result{} t |
| 2163 | @end group | 2167 | @end group |
| 2164 | @group | 2168 | @group |
| 2169 | (file-name-absolute-p "~nosuchuser/foo") | ||
| 2170 | @result{} nil | ||
| 2171 | @end group | ||
| 2172 | @group | ||
| 2165 | (file-name-absolute-p "rms/foo") | 2173 | (file-name-absolute-p "rms/foo") |
| 2166 | @result{} nil | 2174 | @result{} nil |
| 2167 | @end group | 2175 | @end group |