[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] pkl: don't use ':' as a path separator if it's denoting a wi
From: |
Jose E. Marchesi |
Subject: |
Re: [PATCH] pkl: don't use ':' as a path separator if it's denoting a windows drive |
Date: |
Thu, 15 Feb 2024 17:46:11 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Hannes.
Thanks for the patch.
I think this needs a documentation update, i.e. to be mentioned in the
manual (poke.texi)...
> 2024-02-15 Hannes Domani <ssbssa@yahoo.de>
>
> * libpoke/pkl.c: Don't use ':' of windows drives as path separator.
> ---
> libpoke/pkl.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/libpoke/pkl.c b/libpoke/pkl.c
> index 8a826b9d..2f67f757 100644
> --- a/libpoke/pkl.c
> +++ b/libpoke/pkl.c
> @@ -779,6 +779,16 @@ pkl_resolve_module (pkl_compiler compiler,
> if ((e = strchrnul (s, ':')) == s)
> continue;
>
> +#ifdef _WIN32
> + /* Don't use ':' as a path separator if it's between a single
> + letter and a '/', since on Windows paths starting like
> + this "c:/" are just drive letters of absolute paths. */
> + if (e == s + 1
> + && ((*s >= 'a' && *s <= 'z') || (*s >= 'A' && *s <= 'Z'))
> + && e[1] == '/')
> + e = strchrnul (e + 2, ':');
> +#endif
> +
> asprintf (&full_filename, "%.*s/%s%s", (int) (e - s), s, module,
> ext);
>
> if (pk_file_readable (full_filename) == NULL)