diff options
| author | Richard M. Stallman | 1993-08-04 22:51:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-08-04 22:51:22 +0000 |
| commit | 298b760ea5b6c1ccc07290160eb60dc1d63ca1a3 (patch) | |
| tree | 5c06227475c565440d2f119840c57bbfe49fa3c4 /src | |
| parent | 75993094ccf8ce38e22837b1ca20187513a8034d (diff) | |
| download | emacs-298b760ea5b6c1ccc07290160eb60dc1d63ca1a3.tar.gz emacs-298b760ea5b6c1ccc07290160eb60dc1d63ca1a3.zip | |
(expand_and_dir_to_file): Remove final / by copying abspath.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/fileio.c b/src/fileio.c index f4537ba0fda..6a94b2c34da 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1506,11 +1506,7 @@ duplicates what `expand-file-name' does.") | |||
| 1506 | } | 1506 | } |
| 1507 | 1507 | ||
| 1508 | /* A slightly faster and more convenient way to get | 1508 | /* A slightly faster and more convenient way to get |
| 1509 | (directory-file-name (expand-file-name FOO)). The return value may | 1509 | (directory-file-name (expand-file-name FOO)). */ |
| 1510 | have had its last character zapped with a '\0' character, meaning | ||
| 1511 | that it is acceptable to system calls, but not to other lisp | ||
| 1512 | functions. Callers should make sure that the return value doesn't | ||
| 1513 | escape. */ | ||
| 1514 | 1510 | ||
| 1515 | Lisp_Object | 1511 | Lisp_Object |
| 1516 | expand_and_dir_to_file (filename, defdir) | 1512 | expand_and_dir_to_file (filename, defdir) |
| @@ -1530,11 +1526,8 @@ expand_and_dir_to_file (filename, defdir) | |||
| 1530 | stat behaves differently depending! */ | 1526 | stat behaves differently depending! */ |
| 1531 | if (XSTRING (abspath)->size > 1 | 1527 | if (XSTRING (abspath)->size > 1 |
| 1532 | && XSTRING (abspath)->data[XSTRING (abspath)->size - 1] == '/') | 1528 | && XSTRING (abspath)->data[XSTRING (abspath)->size - 1] == '/') |
| 1533 | { | 1529 | abspath = Fsubstring (abspath, make_number (0), |
| 1534 | if (EQ (abspath, filename)) | 1530 | make_number (XSTRING (abspath)->size - 1)); |
| 1535 | abspath = Fcopy_sequence (abspath); | ||
| 1536 | XSTRING (abspath)->data[XSTRING (abspath)->size - 1] = 0; | ||
| 1537 | } | ||
| 1538 | #endif | 1531 | #endif |
| 1539 | return abspath; | 1532 | return abspath; |
| 1540 | } | 1533 | } |