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.bugs Subject: bug#57755: 29.0.50; [PATCH] Fallout 816106b Date: Tue, 13 Sep 2022 14:56:23 +0300 Message-ID: <83wna74heg.fsf@gnu.org> References: <87edwgib1y.fsf@dick> <87bkrki99p.fsf@dick> <87leqn20gn.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26127"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57755@debbugs.gnu.org, dick.r.chiang@gmail.com To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 13 13:57:34 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oY4Xl-0006gC-9v for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Sep 2022 13:57:33 +0200 Original-Received: from localhost ([::1]:43914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oY4Xk-0003hj-9g for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Sep 2022 07:57:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY4XH-0003hV-9n for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2022 07:57:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60399) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oY4XG-0004XD-0a for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2022 07:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oY4XF-0005TQ-Tv for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2022 07:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Sep 2022 11:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57755 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57755-submit@debbugs.gnu.org id=B57755.166307020621017 (code B ref 57755); Tue, 13 Sep 2022 11:57:01 +0000 Original-Received: (at 57755) by debbugs.gnu.org; 13 Sep 2022 11:56:46 +0000 Original-Received: from localhost ([127.0.0.1]:49098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY4X0-0005Su-0C for submit@debbugs.gnu.org; Tue, 13 Sep 2022 07:56:46 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY4Ww-0005Sa-55 for 57755@debbugs.gnu.org; Tue, 13 Sep 2022 07:56:44 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY4Wq-0004VI-PU; Tue, 13 Sep 2022 07:56:36 -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=XiWpsktk3BiGXmWWekaBlkcCP/hTllCYoSgYp6gkV9g=; b=q2BV9SP0/nEF PTx023FZymbbcK4o/O4v7T0drQxFUtuXyAqUAfb8GeoNhYGzXZAVyNXJZTIz7oOZDKjnbmN47ZFVr 7boz3IpCMoIP2TNH8S48pTZ3aeJ+K+PlZwFE1FKJCueI6dlR8Fmuf4WqZFmG9Wm0WpcTsHgzwi2vL PJ+qJ3QqB4ifXZAEDQTDMVKM9mPK23Yv57tet2dKerImVv4B141gooUQL7njDK+lusCVAdbAmwzhl OSDsrRQYWz7ktK4f3CEqHB979WTlhEwE39k8w5vuZXsq4pm6Mjvr6nvdnGXkixP6oFmJE2xS7pfvC mGBCk2Gz5D5tZ9BfxHj96g==; Original-Received: from [87.69.77.57] (port=1778 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 1oY4Wq-0001Px-3G; Tue, 13 Sep 2022 07:56:36 -0400 In-Reply-To: <87leqn20gn.fsf@yahoo.com> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242343 Archived-At: > Cc: 57755@debbugs.gnu.org > Date: Tue, 13 Sep 2022 15:32:56 +0800 > From: Po Lu via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > dick writes: > > > + call2 (intern ("string-trim-right"), build_string (err->message), > > What coding system is err->message? That's a good question, but the same question applies to the original code, because build_string is just a thin wrapper around make_string. (My guess would be that the message is either US ASCII or UTF-8, given its type in glib. But if we want to be more defensive about that, it should be a separate change.) > And calling intern with a static string is IMHO an anti-pattern that > should not be introduced further into our code. I actually don't understand the rationale for calling string-trim-right, not at all. Why do we need such heavy artillery to just remove one newline character? As for replacing of g_clear_error with g_error_free: that's just syntactic sugar, right? It is not a mistake to use g_clear_error there. I see no reason to make such a replacement. AFAIU, the useful part of this patch is that it avoids dereferencing NULL. That part should go in, but I don't think we want the rest.