unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 10284ca3d3: Encode and decode filenames correctly on Haiku
       [not found] <mailman.321.1651645857.3113.emacs-diffs@gnu.org>
@ 2022-05-04  7:10 ` Eli Zaretskii
  2022-05-04  7:26   ` Po Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Eli Zaretskii @ 2022-05-04  7:10 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> 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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: master 10284ca3d3: Encode and decode filenames correctly on Haiku
  2022-05-04  7:10 ` master 10284ca3d3: Encode and decode filenames correctly on Haiku Eli Zaretskii
@ 2022-05-04  7:26   ` Po Lu
  0 siblings, 0 replies; 2+ messages in thread
From: Po Lu @ 2022-05-04  7:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

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

Ah, damn.  I got confused by the order of the wording in this comment:

/* Encode or decode a file name, to or from a unibyte string suitable
   for passing to C library functions.  */

namely how the function immediately following that is
`decode_file_name', but the comment talks about encoding first.

Thanks for pointing this out.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-04  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.321.1651645857.3113.emacs-diffs@gnu.org>
2022-05-04  7:10 ` master 10284ca3d3: Encode and decode filenames correctly on Haiku Eli Zaretskii
2022-05-04  7:26   ` Po Lu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).