diff --git a/src/CHANGELOG b/src/CHANGELOG index afadd5f21..9d16306ad 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -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 diff --git a/src/c/pathname.d b/src/c/pathname.d index 58d6d5969..850504398 100644 --- a/src/c/pathname.d +++ b/src/c/pathname.d @@ -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') diff --git a/src/lsp/config.lsp.in b/src/lsp/config.lsp.in index fe476228c..77aad33bd 100644 --- a/src/lsp/config.lsp.in +++ b/src/lsp/config.lsp.in @@ -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: ()