diff options
| author | Eli Zaretskii | 2001-10-26 21:38:40 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2001-10-26 21:38:40 +0000 |
| commit | 49475635108c55605e3acdb7af390c0a1d6429c4 (patch) | |
| tree | 4d569e0b293b89784bf50da66b2ee76e61963a0f /src | |
| parent | aa32689c0cbd43587d4af58c77b51f35330eb154 (diff) | |
| download | emacs-49475635108c55605e3acdb7af390c0a1d6429c4.tar.gz emacs-49475635108c55605e3acdb7af390c0a1d6429c4.zip | |
(Faccess_file): Run the argument filename through
Fexpand_file_name, before using it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/fileio.c b/src/fileio.c index a5c9972692b..823ab018bcd 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3062,19 +3062,21 @@ If there is no error, we return nil. */) | |||
| 3062 | (filename, string) | 3062 | (filename, string) |
| 3063 | Lisp_Object filename, string; | 3063 | Lisp_Object filename, string; |
| 3064 | { | 3064 | { |
| 3065 | Lisp_Object handler, encoded_filename; | 3065 | Lisp_Object handler, encoded_filename, absname; |
| 3066 | int fd; | 3066 | int fd; |
| 3067 | 3067 | ||
| 3068 | CHECK_STRING (filename, 0); | 3068 | CHECK_STRING (filename, 0); |
| 3069 | absname = Fexpand_file_name (filename, Qnil); | ||
| 3070 | |||
| 3069 | CHECK_STRING (string, 1); | 3071 | CHECK_STRING (string, 1); |
| 3070 | 3072 | ||
| 3071 | /* If the file name has special constructs in it, | 3073 | /* If the file name has special constructs in it, |
| 3072 | call the corresponding file handler. */ | 3074 | call the corresponding file handler. */ |
| 3073 | handler = Ffind_file_name_handler (filename, Qaccess_file); | 3075 | handler = Ffind_file_name_handler (absname, Qaccess_file); |
| 3074 | if (!NILP (handler)) | 3076 | if (!NILP (handler)) |
| 3075 | return call3 (handler, Qaccess_file, filename, string); | 3077 | return call3 (handler, Qaccess_file, absname, string); |
| 3076 | 3078 | ||
| 3077 | encoded_filename = ENCODE_FILE (filename); | 3079 | encoded_filename = ENCODE_FILE (absname); |
| 3078 | 3080 | ||
| 3079 | fd = emacs_open (XSTRING (encoded_filename)->data, O_RDONLY, 0); | 3081 | fd = emacs_open (XSTRING (encoded_filename)->data, O_RDONLY, 0); |
| 3080 | if (fd < 0) | 3082 | if (fd < 0) |