emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 10284ca3d3: Encode and decode filenames correctly on Haiku


From: Eli Zaretskii
Subject: Re: master 10284ca3d3: Encode and decode filenames correctly on Haiku
Date: Wed, 04 May 2022 10:10:26 +0300

> branch: master
> commit 10284ca3d3a01505c3f19668f7e00586cac414b5
> Author: Po Lu <luangruo@yahoo.com>
> Commit: Po Lu <luangruo@yahoo.com>
> 
>     Encode and decode filenames correctly on Haiku
>     
>     * src/haikufns.c (Fhaiku_read_file_name): Decode file names
>     correctly.
> ---
>  src/haikufns.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/haikufns.c b/src/haikufns.c
> index 3e3104193e..bee41e4ec0 100644
> --- a/src/haikufns.c
> +++ b/src/haikufns.c
> @@ -2482,7 +2482,10 @@ Optional arg SAVE_TEXT, if non-nil, specifies some 
> text to show in the entry fie
>      error ("Trying to use a menu from within a menu-entry");
>  
>    if (!NILP (dir))
> -    CHECK_STRING (dir);
> +    {
> +      CHECK_STRING (dir);
> +      dir = DECODE_FILE (dir);
> +    }
>  
>    if (!NILP (save_text))
>      CHECK_STRING (save_text);
> @@ -2513,7 +2516,7 @@ Optional arg SAVE_TEXT, if non-nil, specifies some text 
> to show in the entry fie
>    value = build_string (file_name);
>    free (file_name);
>  
> -  return value;
> +  return ENCODE_FILE (value);
>  }
>  
>  DEFUN ("haiku-put-resource", Fhaiku_put_resource, Shaiku_put_resource,

Isn't this backwards?  File names need to be _encoded_ when passed to
system APIs, and _decoded_ when returning them back to Emacs.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]