From a3460edbe8122e06a5b465538597bb3e0a5a3f86 Mon Sep 17 00:00:00 2001 From: Florian Margaine Date: Wed, 6 Sep 2017 10:38:56 +0200 Subject: [PATCH 1/3] Fix warning on non-windows about unused label. Given that the label is only goto'd on Windows, the compiler is spewing out a warning when running on non-windows for the unused label. --- src/c/pathname.d | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/c/pathname.d b/src/c/pathname.d index d84c6dcc6..3f394ebbb 100644 --- a/src/c/pathname.d +++ b/src/c/pathname.d @@ -659,6 +659,7 @@ ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep, if (!ecl_stringp(device)) { return ECL_NIL; } +#if defined(ECL_MS_WINDOWS_HOST) maybe_parse_host: /* Files have no effective device. */ if (@string-equal(2, device, @':file') == ECL_T) @@ -682,6 +683,7 @@ ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep, } if (ecl_length(device) == 0) device = ECL_NIL; +#endif done_device_and_host: path = parse_directories(s, 0, *ep, end, ep); if (CONSP(path)) { -- GitLab From 911944a2f9944b05d490f17c0b1041d2d8009b3a Mon Sep 17 00:00:00 2001 From: Florian Margaine Date: Wed, 6 Sep 2017 11:27:42 +0200 Subject: [PATCH 2/3] Remove unused argument. It's not used anywhere, and just looks like typo overall. --- src/c/pathname.d | 2 +- src/h/external.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c/pathname.d b/src/c/pathname.d index 3f394ebbb..0336d9bd0 100644 --- a/src/c/pathname.d +++ b/src/c/pathname.d @@ -1709,7 +1709,7 @@ copy_list_wildcards(cl_object *wilds, cl_object to) return l; } -@(defun translate-pathname (source from to &key ((:case scase) @':local')) +@(defun translate-pathname (source from to) cl_object wilds, d; cl_object host, device, directory, name, type, version; cl_object fromcase, tocase; diff --git a/src/h/external.h b/src/h/external.h index dba2dbda3..b448d42a0 100755 --- a/src/h/external.h +++ b/src/h/external.h @@ -1346,7 +1346,7 @@ extern ECL_API cl_object cl_directory_namestring(cl_object pname); extern ECL_API cl_object cl_host_namestring(cl_object pname); extern ECL_API cl_object si_logical_pathname_p(cl_object pname); extern ECL_API cl_object cl_pathname_match_p(cl_object path, cl_object mask); -extern ECL_API cl_object cl_translate_pathname _ECL_ARGS((cl_narg narg, cl_object source, cl_object from, cl_object to, ...)); +extern ECL_API cl_object cl_translate_pathname _ECL_ARGS((cl_narg narg, cl_object source, cl_object from, cl_object to)); extern ECL_API cl_object cl_translate_logical_pathname _ECL_ARGS((cl_narg narg, cl_object source, ...)); extern ECL_API cl_object cl_parse_namestring _ECL_ARGS((cl_narg narg, cl_object thing, ...)); extern ECL_API cl_object cl_parse_logical_namestring _ECL_ARGS((cl_narg narg, cl_object thing, ...)); -- GitLab From 186f3725ed85f3830eb6f7d7e7f29d6ac51ddda9 Mon Sep 17 00:00:00 2001 From: Florian Margaine Date: Wed, 6 Sep 2017 12:13:25 +0200 Subject: [PATCH 3/3] Don't evaluate logical pathname translations at read-time. ecl_parse_namestring() is called at read-time by sharp_P_reader() when a literal #P"" pathname is used. At this time, the logical pathname translations have not been setup, so the pathname will always be defined as non-logical (except for #P"SYS:" pathnames, which translation is defined earlier by ECL), and later translating will skip the lookup in the translation table. (See cl_translate_logical_pathname()'s early return.) This problem does not exhibit itself in interpreted mode, because the namestring is parsed when it is met, i.e. after the translations have been setup. This change makes it so that if a string is parsed as a logical hostname, then it will be treated as such, which is as the specification says. (See PARSE-NAMESTRING.) This does mean that this is a breaking change. Previously, (TRANSLATE-LOGICAL-PATHNAME #P"FOO:BAR;BAZ") was returning NIL, it will now error as the pathname is now recognized as logical, and the host will always be searched in the translations. This is, however, also a fix to make ECL ever-so-slightly more compliant. The specification explicitly says that TRANSLATE-LOGICAL-PATHNAME should signal a file-error error when a pathname parsed as a logical pathname matches no translation. Fixes #404 --- src/c/pathname.d | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/c/pathname.d b/src/c/pathname.d index 0336d9bd0..2733bdead 100644 --- a/src/c/pathname.d +++ b/src/c/pathname.d @@ -523,9 +523,7 @@ parse_directories(cl_object s, int flags, cl_index start, cl_index end, bool ecl_logical_hostname_p(cl_object host) { - if (!ecl_stringp(host)) - return FALSE; - return !Null(@assoc(4, host, cl_core.pathname_translations, @':test', @'string-equal')); + return ecl_stringp(host); } /* -- GitLab