Pathnames such as //usr were improperly parsed. We have thus changed the physical pathname syntax

This commit is contained in:
jgarcia 2008-01-06 23:19:38 +00:00
parent 4356e84222
commit 1e7bda1f22
3 changed files with 30 additions and 24 deletions

View file

@ -12,6 +12,10 @@ ECL 0.9k:
- Improved hashing on 64-bit machines.
- The physical pathname format has changed from [device:][[//hostname]/]...
to [[device:[//hostname]]/]... The reason is that this allows proper
parsing of Unix pathnames such as "//usr/".
* CLOS:
- When caching generic function calls, ECL now uses a thread-local hash table

View file

@ -535,38 +535,40 @@ ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep,
physical:
/*
* Physical pathname format:
* [device:][[//hostname]/][directory-component/]*[pathname-name][.pathname-type]
* [[device:[//hostname]]/][directory-component/]*[pathname-name][.pathname-type]
*/
logical = FALSE;
device = parse_word(s, is_colon, WORD_INCLUDE_DELIM|WORD_EMPTY_IS_NIL,
start, end, ep);
if (device == @':error')
if (device == @':error' || device == Cnil) {
/* We only parse a hostname when the device was present. */
device = Cnil;
else if (device != Cnil) {
if (!ecl_stringp(device))
return Cnil;
host = Cnil;
} else if (!ecl_stringp(device)) {
return Cnil;
} else {
/* Files have no effective device. */
if (@string-equal(2, device, @':file') == Ct)
device = Cnil;
}
start = *ep;
if ((start+2) <= end && is_slash(ecl_char(s, start)) &&
is_slash(ecl_char(s, start+1)))
{
host = parse_word(s, is_slash, WORD_EMPTY_IS_NIL,
start+2, end, ep);
if (host != Cnil) {
start = *ep;
if (is_slash(ecl_char(s,--start))) *ep = start;
start = *ep;
host = Cnil;
if ((start+2) <= end && is_slash(ecl_char(s, start)) &&
is_slash(ecl_char(s, start+1)))
{
host = parse_word(s, is_slash, WORD_EMPTY_IS_NIL,
start+2, end, ep);
if (host == @':error') {
host = Cnil;
} else if (host != Cnil) {
if (!ecl_stringp(host))
return Cnil;
start = *ep;
if (is_slash(ecl_char(s,--start)))
*ep = start;
}
}
} else {
host = Cnil;
}
if (host == @':error') {
host = Cnil;
} else if (host != Cnil) {
if (!ecl_stringp(host))
return Cnil;
}
done_device_and_host:
path = parse_directories(s, 0, *ep, end, ep);
if (CONSP(path)) {
if (CAR(path) != @':relative' && CAR(path) != @':absolute')

View file

@ -24,7 +24,7 @@ Returns, as a string, the location of the machine on which ECL runs."
(defun lisp-implementation-version ()
"Args:()
Returns the version of your ECL as a string."
"@PACKAGE_VERSION@ (CVS 2008-01-06 16:18)")
"@PACKAGE_VERSION@ (CVS 2008-01-07 00:20)")
(defun machine-type ()
"Args: ()