TRUENAME now properly reinterprets file pathnames as directory pathnames if the file system shows that the user supplied a wrong value.

This commit is contained in:
Juan Jose Garcia Ripoll 2009-06-17 20:20:04 +02:00
parent 4825462d9e
commit 40d7f14305
2 changed files with 19 additions and 1 deletions

View file

@ -5,6 +5,10 @@ ECL 9.6.2:
- Reimplemented winsock streams using the new file structures (D. Statyvka)
- TRUENAME now properly reinterprets file pathnames as directory pathnames
if the file system shows that the user supplied a wrong value. For instance
(TRUENAME "/tmp") => #P"/tmp/"
* Bugs:
- Fixed a bug in the compiler that prevented building with MSVC
@ -19,6 +23,8 @@ ECL 9.6.2:
- The command :bds no longer chokes when finding unbound special variables.
- Fixed a problem with SI:MKSTEMP under windows (DS).
* Numerics:
- EXT:OUTPUT-FLOAT-NAN and EXT:OUTPUT-FLOAT-INFINITY can be redefined to

View file

@ -260,7 +260,19 @@ cl_truename(cl_object orig_pathname)
Cnil, Cnil, Cnil));
#endif
} else {
filename = OBJNULL;
/* If the pathname is a directory but we have supplied
a file name, correct the type by appending a directory
separator and re-parsing again the namestring */
if (kind == @':directory' &&
(pathname->pathname.name != Cnil ||
pathname->pathname.type != Cnil)) {
pathname = si_base_string_concatenate
(2, filename,
make_constant_base_string("/"));
pathname = cl_pathname(pathname);
cl_print(1,pathname);
goto BEGIN;
} filename = OBJNULL;
}
change_drive(pathname);
for (dir = pathname->pathname.directory;