diff options
| author | Richard M. Stallman | 1996-10-04 04:26:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-10-04 04:26:09 +0000 |
| commit | c49afcd7007b6361da51c3b4d952e44ec43bd83f (patch) | |
| tree | c9f1762c49f9bf241598c027aaf364509da35423 /src | |
| parent | 6d7d9efad3111b3145d6cf46b45f1cebf5faf2ca (diff) | |
| download | emacs-c49afcd7007b6361da51c3b4d952e44ec43bd83f.tar.gz emacs-c49afcd7007b6361da51c3b4d952e44ec43bd83f.zip | |
(openp): Omit /: from start of file name.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/lread.c b/src/lread.c index 8dab8ee74c4..b74f1554883 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -635,9 +635,22 @@ openp (path, str, suffix, storeptr, exec_only) | |||
| 635 | char *esuffix = (char *) index (nsuffix, ':'); | 635 | char *esuffix = (char *) index (nsuffix, ':'); |
| 636 | int lsuffix = esuffix ? esuffix - nsuffix : strlen (nsuffix); | 636 | int lsuffix = esuffix ? esuffix - nsuffix : strlen (nsuffix); |
| 637 | 637 | ||
| 638 | /* Concatenate path element/specified name with the suffix. */ | 638 | /* Concatenate path element/specified name with the suffix. |
| 639 | strncpy (fn, XSTRING (filename)->data, XSTRING (filename)->size); | 639 | If the directory starts with /:, remove that. */ |
| 640 | fn[XSTRING (filename)->size] = 0; | 640 | if (XSTRING (filename)->size > 2 |
| 641 | && XSTRING (filename)->data[0] == '/' | ||
| 642 | && XSTRING (filename)->data[1] == ':') | ||
| 643 | { | ||
| 644 | strncpy (fn, XSTRING (filename)->data + 2, | ||
| 645 | XSTRING (filename)->size - 2); | ||
| 646 | fn[XSTRING (filename)->size - 2] = 0; | ||
| 647 | } | ||
| 648 | else | ||
| 649 | { | ||
| 650 | strncpy (fn, XSTRING (filename)->data, XSTRING (filename)->size); | ||
| 651 | fn[XSTRING (filename)->size] = 0; | ||
| 652 | } | ||
| 653 | |||
| 641 | if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ | 654 | if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ |
| 642 | strncat (fn, nsuffix, lsuffix); | 655 | strncat (fn, nsuffix, lsuffix); |
| 643 | 656 | ||