From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 10284ca3d3: Encode and decode filenames correctly on Haiku Date: Wed, 04 May 2022 10:10:26 +0300 Message-ID: <838rrh4vtp.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9684"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 04 09:31:48 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nm9UB-0002Q3-Rp for ged-emacs-devel@m.gmane-mx.org; Wed, 04 May 2022 09:31:48 +0200 Original-Received: from localhost ([::1]:47788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nm9UA-0005FU-IN for ged-emacs-devel@m.gmane-mx.org; Wed, 04 May 2022 03:31:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nm99M-0003tC-50 for emacs-devel@gnu.org; Wed, 04 May 2022 03:10:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nm99L-0006rd-PL; Wed, 04 May 2022 03:10:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZdSSb7ZqhEXpTmKQ1fhOwCF1hfQDWAv8MhHBwqbKSUg=; b=UmHUCp6UAhTI OGBVmQekTyjl6KSye+9gbMg90rPo+9LBslajvU44kN9qg6a6c9DI6XY1nZQ7Ozbn8YVO0YvbsiUfK 6e5nkilbYzNJT5UKk9ItTQWnm3P4GoC+OPjegMR37nGTGzgXsl8sJTn3GjdJQ9b6etE+r2szpPhMy FgTL+CvUMe/usENdi3L+NFh0KZwuLKXA/ZO6MsBLPHLWJ/8jkQdAfbN9tQpK/GFvZ1e7vLODmUZQf 4h5JucCKIPivFmIWthIdOTLoeIt4uHc6qLit5Ip+AmFnZT0w74y3gk/kQRNxjCG4KFIWYUZ21tq/g p0z3uAcbYPzJlWNeCeT+8A==; Original-Received: from [87.69.77.57] (port=3335 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nm99I-00069A-Ij; Wed, 04 May 2022 03:10:13 -0400 In-Reply-To: (emacs-diffs-request@gnu.org) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289153 Archived-At: > branch: master > commit 10284ca3d3a01505c3f19668f7e00586cac414b5 > Author: Po Lu > Commit: Po Lu > > 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.