Received: (at 81104) by debbugs.gnu.org; 24 May 2026 11:19:37 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 24 07:19:36 2026 Received: from localhost ([127.0.0.1]:33488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1wR6rm-0005bF-OA for submit <at> debbugs.gnu.org; Sun, 24 May 2026 07:19:36 -0400 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]:46983) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1wR6rj-0005Zs-8V for 81104 <at> debbugs.gnu.org; Sun, 24 May 2026 07:19:32 -0400 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id DCEFDEC0121; Sun, 24 May 2026 07:19:25 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Sun, 24 May 2026 07:19:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1779621565; x=1779707965; bh=YHDb6Qh3ZPtOLyEuOw4SYVo+NZgYBk7UT1EUh3NgFBw=; b= HFXNM4AUk9ukB+MtcQ9i7nOyl/MmzT8Vus2PSVhogEqs++IM9gCk9jUkf0oEyihG tzwc+lZgx1egBzrgqBrDlbQyqvT+lxiF7nM4JJaZBEsd/3ZjeRszK/vKplaOg/dv 47tCh5OZAvkEsL370bdUNuGMKD7Ffg0vGBTmDqAlOdtsSCB9mNqOpVFIakcmX0R2 Wu0a20Ebt/LSnOha/RZz/2ppAJqxWSvHwKRYBUuTeQbHp0Ok32nJele2+OuGMKjZ Kewcs455gN3iSy0elzlZc2yc8891t4WUu5Rg56BuOwuktR93o9dCI/jmBxlwOvJ4 ZhHBYANPgVydT79LrMnYbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1779621565; x= 1779707965; bh=YHDb6Qh3ZPtOLyEuOw4SYVo+NZgYBk7UT1EUh3NgFBw=; b=Q SvS9d6z6sddAsjZXtIdNQ5zp7bb+bAIC0zbJxzuxrfOnsHL6alhlsFMeP9k8mQaG /nhBDj5hY18J/Yxjlc4++4HpDGh17o1O1R42R+CDb1yuh2FhlszCaelw0/+rFggl CpBkqJMy2Rd3e8B0P9Q04GMYDcmSdoavS7Bq1zuMWvFJ4idh3ele1plAauSEAhig vTNngkucV52VwpI8BknVoXCs6FB00KO/NowEB92m6vjMw4vHZ4IfMSwIrEq2OqVR SIkjvSxFAYWufMt1zIx1fXxIm54rgKDHSpPvpTIrnVa/qW/0FZqI1OBSK8vu9Eei k+TFztbswxBSR1ET70u5A== X-ME-Sender: <xms:vd4SajSggvHv5m0g95aGDd-NhjeE9ZMjJ4lfHQCX8KyV_g-7gdQwlg> <xme:vd4SasPlTqrBlU4No4uKCUxyAjmvZdMQObd5rSUszoxu5Ez7b7aoG1BC_ZFRXOB4H keZJqMCsKnEpob1XKXiqVVAuJgw_20enOqFo3CZ9yXsyqanqviKM2c> X-ME-Received: <xmr:vd4SamMOR4Rr_N-oPAjpRgOla-1Bx4jRqgARcRd6aMy7M-OZ1wN6kb4Ey3QjXDKeKS7NCQ> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduheehjeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhithhr hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg hrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedujeeh necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih htrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhp ohhuthdprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg dprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopeekuddutdegsegu vggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: <xmx:vd4SasuVPC_Zxvy8rg5414M4GtPcUKsSHCzrQ3Eu5KpzxKoaCaS_dQ> <xmx:vd4SagWl5Rbg7SsDQmxsjzReGG3qCvdWNMYN7_ZQNN_Sz8INMK4LMw> <xmx:vd4SaktCN5Mh5sA5KscPtSbcNzqgnoouNIkZiZdZLO4a8VrTRB1fpA> <xmx:vd4SasWlDel_K4Ua8nbUBY60waJHBXT8kkWhrY3jW9PukgZCtDdJpw> <xmx:vd4Sasvv6L3pYqM7iv8xaXak7pBGNT3hNUfkVOZA2tZFtLdossy1HabB> Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 24 May 2026 07:19:24 -0400 (EDT) Message-ID: <d606c5ba-8b9c-4513-917f-e383d2b259ad@HIDDEN> Date: Sun, 24 May 2026 14:19:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#81104: Buggy file name when emacsclient fails over to terminal twice To: Sean Whitton <spwhitton@HIDDEN>, Eli Zaretskii <eliz@HIDDEN> References: <01d5a708-bb81-4cb7-8e24-2a4f60a779fc@HIDDEN> <87fr3i59f9.fsf@HIDDEN> <86v7cdtnwl.fsf@HIDDEN> <87a4tp5daa.fsf@HIDDEN> Content-Language: en-US From: Dmitry Gutov <dmitry@HIDDEN> In-Reply-To: <87a4tp5daa.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 81104 Cc: 81104 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Hi! On 24/05/2026 13:10, Sean Whitton wrote: > Eli Zaretskii [24/May 7:46am +03] wrote: >> Are we sure? This makes a non-trivial change in the control flow, and >> the situation where the problem happens is a rare one at best. >> emacsclient had enough significant changes in Emacs 31 that were >> meanwhile tested by people who tracked the master branch, whereas this >> change will not have any significant testing before the pretest. > That's fine, I'm happy with being more cautious. So what is the consensus? Fix it just on master? I don't have any particular urgency, just should point out that the change is on the main path, and on the retry path. The main path would be tested daily my all emacsclient users.
bug-gnu-emacs@HIDDEN:bug#81104; Package emacs.
Full text available.Received: (at 81104) by debbugs.gnu.org; 24 May 2026 10:10:17 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 24 06:10:17 2026 Received: from localhost ([127.0.0.1]:33153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1wR5mj-0003Wh-GW for submit <at> debbugs.gnu.org; Sun, 24 May 2026 06:10:17 -0400 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]:57633) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>) id 1wR5mf-0003WJ-BU for 81104 <at> debbugs.gnu.org; Sun, 24 May 2026 06:10:15 -0400 Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id 6CD9A1D0004D; Sun, 24 May 2026 06:10:07 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Sun, 24 May 2026 06:10:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1779617407; x= 1779703807; bh=rubVBbLb5BQUdf2pYAigGDU6gSps6tnVikq4ZrWo8gs=; b=z CoMAM1k3yiGwsJks33NaIF/mGYWNXqDOHn98KYGKO79lmXlGLc0MF7ME/8sf14NO 8lipWRMQ84OjFNaneEdJV0DD/s5XRvVZRrQU7/Fwtyk4YZJpKbkBhKSQ9K7IpOvr 4WX/TmDK606JgdJ4vLFtUGGwrkRNDZ6h93kqdlc8oaRt6Z4Jl/iD5UXL8v5eCL1C Q+LGVlHcsZu8vlhqor6bvnOd7uJGjquNQEs3vpkYuTRKu9P9asf8drAIHX09BCxW PYsvjYC0PZ0yzCPTbVbI70tOvErzUackY2q41W4p0KnBbp64OwJKKh6xlYskp6RY K8MwAhrRpXBa7YUBwcWuA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1779617407; x=1779703807; bh=rubVBbLb5BQUdf2pYAigGDU6gSps6tnVikq 4ZrWo8gs=; b=tGV7aPb0N6p8E//B38pWJChjFaTft6ZhDmswB9kW4RBUSo8C5XG FyRLUo/+YRYOf9CL0Bzz2Q2MHlf9b63GDi3Kz9t0QuMIukDLXTMkog6jAtHRK+SC WUL7EomjK63WAwAY8n42h/JTmwrSXOL11lUrKYaOs6gVDKoZxqJU5rPe5PM6yl+u zfubmD0EnIw1h6ZJL9ZVLb9680wRa/EnsHIgKTwxbLOAAQU/SAEkWDlmkIOeMkv4 nyKikfdCcGKSoMjL1Q/XR52P58X4El4iIapTpifpamv2JT48tEhuxSBvWFuPp8NK nb8etP5aNwl9pTJoL7Yw93erRck3r962BLg== X-ME-Sender: <xms:fs4SaniNsAyMgpC3t_RMAGAntXuRsRLRKTudlDhOk11FTDKMRz61eg> <xme:fs4SarcDuDLBYRfIyTtdENy2-hUjntfoUMaciz6qzcgQ5PzOOHOI4NHFfEkC-Fnn8 ggM6r5FCkfn-2JqoTyzQpjL-dsJz8hLXASmnFnx66qITLNpw16IRLM> X-ME-Received: <xmr:fs4SakcH4j66qwDTZGZHRU-4xVNlOz85jtsnBndsBkvdJEGUbCNyEGRL1HeX9vZLO_z3jyON7TTIrI7nLW6AmV1zXWjbgA> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduheehieehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefujghffffkgggtsehttddttddttddtnecuhfhrohhmpefuvggrnhcuhghh ihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqnecugg ftrfgrthhtvghrnhepvddvheeggffhuefhleekudffhefgheekfeetkeffgfffvdeufeeu gfdufffhudfhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvpdhnsggprhgtphht thhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeekuddutdegseguvggssg hughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghp thhtohepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: <xmx:fs4Sat9mBQnKn51Ip2VMJBHiXsV1abozu1sL4i_PnpJQkyXBu5pexA> <xmx:fs4SaomirlMqYum1r3he1DQ1DwTy5ZuF3F7i0v6WwKlqEdwx_-FWjw> <xmx:fs4San_LPzaBWaSG4GGisoJ4zNi2YZQWKmV39NqpHIfi_5H_ERqwcA> <xmx:fs4SaunI5JIQ9m0Cwu0EFywlZqCKMZOUu-0DGm1gjWJYWPXrOv_6JA> <xmx:f84Saj2YL45FvoMea7F6fUeqPCS-cM_lJadhpnJCRtUWNusFtYTahDfp> Feedback-ID: i62564b17:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 24 May 2026 06:10:06 -0400 (EDT) Received: by melete.silentflame.com (Postfix, from userid 1000) id 888097E66D2; Sun, 24 May 2026 11:10:05 +0100 (BST) From: Sean Whitton <spwhitton@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#81104: Buggy file name when emacsclient fails over to terminal twice In-Reply-To: <86v7cdtnwl.fsf@HIDDEN> References: <01d5a708-bb81-4cb7-8e24-2a4f60a779fc@HIDDEN> <87fr3i59f9.fsf@HIDDEN> <86v7cdtnwl.fsf@HIDDEN> Date: Sun, 24 May 2026 11:10:05 +0100 Message-ID: <87a4tp5daa.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 81104 Cc: dmitry@HIDDEN, 81104 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Eli Zaretskii [24/May 7:46am +03] wrote: > Are we sure? This makes a non-trivial change in the control flow, and > the situation where the problem happens is a rare one at best. > emacsclient had enough significant changes in Emacs 31 that were > meanwhile tested by people who tracked the master branch, whereas this > change will not have any significant testing before the pretest. That's fine, I'm happy with being more cautious. -- Sean Whitton
bug-gnu-emacs@HIDDEN:bug#81104; Package emacs.
Full text available.
Received: (at 81104) by debbugs.gnu.org; 24 May 2026 04:47:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 24 00:47:06 2026
Received: from localhost ([127.0.0.1]:58252 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1wR0jv-0005CB-Sp
for submit <at> debbugs.gnu.org; Sun, 24 May 2026 00:47:06 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41016)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1wR0jr-0005Al-MD
for 81104 <at> debbugs.gnu.org; Sun, 24 May 2026 00:47:01 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
id 1wR0jl-0005IV-Rv; Sun, 24 May 2026 00:46:53 -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=YFfqV0jE8p5PI1RGuYkK5/Tf/6BL/wTLANoHnJsZO00=; b=UuNO3p8T2L/h
dVXTJPHXLs1vYhACpnk01tXxmy0xzxWSg7ql0oFj5/MvhC4/yQo3oix72VtaLd8PiCoPbGjWpN+5I
sBNtNN33z4G/apg7GbudW5bFMVQMeolax3S6FvvIBRDegip3DN5u6AlNqh9rBGEF8PPCgHHen8cTt
O3mShckGVi1ttAv6iTBlnD5S24Ll0eXlQGx2w1QTdA3ZJ1uo4NpEO0vbJ0afeBDqCMhXbtRKc9+hx
I2JMCvay58JJLjcAHgmG2srN36JQerLzczAaaBJZvwqLUbMvWVIkW1O0+8i3Nk0VM/0bD2Lv40wyI
Vt5hAL8tDNGhOSzN4t90FQ==;
Date: Sun, 24 May 2026 07:46:50 +0300
Message-Id: <86v7cdtnwl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
In-Reply-To: <87fr3i59f9.fsf@HIDDEN> (message from Sean
Whitton on Sat, 23 May 2026 18:21:14 +0100)
Subject: Re: bug#81104: Buggy file name when emacsclient fails over to terminal
twice
References: <01d5a708-bb81-4cb7-8e24-2a4f60a779fc@HIDDEN>
<87fr3i59f9.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81104
Cc: dmitry@HIDDEN, 81104 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
> From: Sean Whitton <spwhitton@HIDDEN>
> Date: Sat, 23 May 2026 18:21:14 +0100
>
> Dmitry Gutov [23/May 4:08am +03] wrote:
> > To reproduce, start the daemon and launch emacsclient with faulty -d
> > parameter (which makes it fail over to running in terminal) and a file
> > name that includes a directory part, twice.
> >
> > 1. src/emacs --daemon
> >
> > 2. lib-src/emacsclient -d :99 -c admin/find-gc.el
> >
> > 3. lib-src/emacsclient -d :99 -c admin/find-gc.el # again
> >
> > The second time the client visits admin/admin/find-gc.el, which does not
> > exist - so I get an empty buffer.
> >
> > Reproduces now and in Emacs 30 too (haven't tried versions older).
> >
> > Proposed fix below:
> >
> > diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
> > index 0769c94a89d..065243d46ef 100644
> > --- a/lib-src/emacsclient.c
> > +++ b/lib-src/emacsclient.c
> > @@ -2066,15 +2066,14 @@ main (int argc, char **argv)
> > send_to_emacs (emacs_socket, " ");
> > }
> > }
> > + retry:
> > send_to_emacs (emacs_socket, "-dir ");
> > if (tramp_prefix)
> > quote_argument (emacs_socket, tramp_prefix);
> > quote_argument (emacs_socket, cwd);
> > - free (cwd);
> > send_to_emacs (emacs_socket, "/");
> > send_to_emacs (emacs_socket, " ");
> >
> > - retry:
> > if (nowait)
> > send_to_emacs (emacs_socket, "-nowait ");
> >
> > @@ -2350,6 +2349,8 @@ main (int argc, char **argv)
> > memmove (recv_buf, p, nrecv);
> > }
> >
> > + free (cwd);
> > +
> > if (!skiplf && 0 <= process_grouping ())
> > printf ("\n");
>
> LGTM, and I think this is okay for the emacs-31 branch, thanks.
Are we sure? This makes a non-trivial change in the control flow, and
the situation where the problem happens is a rare one at best.
emacsclient had enough significant changes in Emacs 31 that were
meanwhile tested by people who tracked the master branch, whereas this
change will not have any significant testing before the pretest.
bug-gnu-emacs@HIDDEN:bug#81104; Package emacs.
Full text available.
Received: (at 81104) by debbugs.gnu.org; 23 May 2026 17:21:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 23 13:21:24 2026
Received: from localhost ([127.0.0.1]:51383 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1wQq2O-0006hT-01
for submit <at> debbugs.gnu.org; Sat, 23 May 2026 13:21:24 -0400
Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]:53623)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
id 1wQq2L-0006h8-C1
for 81104 <at> debbugs.gnu.org; Sat, 23 May 2026 13:21:21 -0400
Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46])
by mailfout.phl.internal (Postfix) with ESMTP id F1C75EC016D;
Sat, 23 May 2026 13:21:15 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
by phl-compute-06.internal (MEProxy); Sat, 23 May 2026 13:21:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name;
h=cc:content-type:content-type:date:date:from:from:in-reply-to
:in-reply-to:message-id:mime-version:references:reply-to:subject
:subject:to:to; s=fm2; t=1779556875; x=1779643275; bh=Dty+EbCLmy
SO46PZ8iUkeORaf0xfgQhMlqdj78rZ3JQ=; b=IYMJM2+DCS1xyc7FPc/l3pAl3c
lx5jA3P83tOPcsnbHs7/Km8Go4QdVTFULEZRb9jkeVSTS7jfVVpGWhoJcyOVF3FS
JHE7KddS2qi/5lSjHG6V0NRcIkoPFx2y+d3uz2AuoDXMSgNDpd45fdoLHpjzbDvZ
lI1MaS6WVCh6+yt6TTcqOZuVhMonGhHOEuywPcJ60i9vTprLMr57KyeohZUwj0Ye
vxwBNXmHzZNrRwQtaQLcJm2C2Mvlqy4j/fOvVa4JUlpP+TMDyWzBztpln5KIooqk
pC+a4YKgA3QJnzmOlzZSgf15mq5VTHRLT7FL2gB5caHniKgp7W36+AMnaTKQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:content-type:content-type:date:date
:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
:message-id:mime-version:references:reply-to:subject:subject:to
:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=
1779556875; x=1779643275; bh=Dty+EbCLmySO46PZ8iUkeORaf0xfgQhMlqd
j78rZ3JQ=; b=kSCEqVjEYwRO27b8r0huw9CjMCKmR8wwGy9wV3Y1y6fRVTYcYzo
cNFh6S/Fw4pYnkd7T07+DHVL8FZENhipmsuUQ6cNPKkeI0q9zfgCo56KYbRBDN3v
nFGfX5Nhj4QEergSaPQgktQOWuHT8psQAiuYvdX1Xi9+MOOqp2+8fi+RR1FrVWTu
SWAAI0NwyVdbhaYAHgQvpe/CASppBKTgb9erguyV8M4mrAs1GK4rwO0dfCDPTYZn
cE+TFBfrYAxyWV5Z6TWyrXvFsJfzMLN75crZ6aahum6KxusGzV4U3UHavFrsLbAV
MDmCf2C2iY356Ysr1lKUaB1a/8B0zYnPGAg==
X-ME-Sender: <xms:C-IRamYWn36wRuY_hTUltT_oLqicTOYTdjYaMVLTW-c_BP6ySFtOlQ>
<xme:C-IRavbMd8qoNN1SLJkUSd6QZJWBqCTokFc2Yruct21TSxZ-0Sqi7sqCJ6rzBy8II
cmULM0M1Kzu7BY9tJPFts_ayh-_WQcQKi4Arox0H3unjZj-LFAMmt0>
X-ME-Received: <xmr:C-IRauk-OFLL7BQEFiloxZ-Y2IqdYtO0Jkyfg4z-udCjSu7DYW_FUUkxnzTABEGGlElXK7vFe0vJU2kDlXO6tE0pXFf0pA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduheefieegucetufdoteggodetrf
dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
gurhephffvufgjfhffkfggtgesthdttddttddttdenucfhrhhomhepufgvrghnucghhhhi
thhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqeenucggtf
frrghtthgvrhhnpeehgfetvdefhffffedtieeuueefleegjefgvdegffejgeehvdeuueeh
ffevhfdvvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh
hmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgdpnhgspghrtghpthht
ohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepkeduuddtgeesuggvsggsuh
hgshdrghhnuhdrohhrghdprhgtphhtthhopegumhhithhrhiesghhuthhovhdruggvvh
X-ME-Proxy: <xmx:C-IRajxoHr8AGiqILwSS4tboDOHzdgIuNB-Kyx4qKsoM-y22mlGxzw>
<xmx:C-IRakPHrrrTF8FNgs7AhZLzmjdmgcqa7tBjURaWmhNnNuhdviPTBA>
<xmx:C-IRavT0zOwNLZlveoX34bx3DvNi0gXk1p4nB2-Mnhbq5chU6tzUkg>
<xmx:C-IRaqY23DtXv6tz_FoTuSk7fGB6UUHnudLKQp6C7Z03mU-bfbYagA>
<xmx:C-IRamcPvfEMN_rePseJNnW3mgvYhfyHRhlavA9V-o6VRw2ztMNYpthT>
Feedback-ID: i62564b17:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
23 May 2026 13:21:15 -0400 (EDT)
Received: by melete.silentflame.com (Postfix, from userid 1000)
id 608617E7141; Sat, 23 May 2026 18:21:14 +0100 (BST)
From: Sean Whitton <spwhitton@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>, 81104 <at> debbugs.gnu.org
Subject: Re: bug#81104: Buggy file name when emacsclient fails over to
terminal twice
In-Reply-To: <01d5a708-bb81-4cb7-8e24-2a4f60a779fc@HIDDEN>
References: <01d5a708-bb81-4cb7-8e24-2a4f60a779fc@HIDDEN>
Date: Sat, 23 May 2026 18:21:14 +0100
Message-ID: <87fr3i59f9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 81104
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)
Dmitry Gutov [23/May 4:08am +03] wrote:
> To reproduce, start the daemon and launch emacsclient with faulty -d
> parameter (which makes it fail over to running in terminal) and a file
> name that includes a directory part, twice.
>
> 1. src/emacs --daemon
>
> 2. lib-src/emacsclient -d :99 -c admin/find-gc.el
>
> 3. lib-src/emacsclient -d :99 -c admin/find-gc.el # again
>
> The second time the client visits admin/admin/find-gc.el, which does not
> exist - so I get an empty buffer.
>
> Reproduces now and in Emacs 30 too (haven't tried versions older).
>
> Proposed fix below:
>
> diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
> index 0769c94a89d..065243d46ef 100644
> --- a/lib-src/emacsclient.c
> +++ b/lib-src/emacsclient.c
> @@ -2066,15 +2066,14 @@ main (int argc, char **argv)
> send_to_emacs (emacs_socket, " ");
> }
> }
> + retry:
> send_to_emacs (emacs_socket, "-dir ");
> if (tramp_prefix)
> quote_argument (emacs_socket, tramp_prefix);
> quote_argument (emacs_socket, cwd);
> - free (cwd);
> send_to_emacs (emacs_socket, "/");
> send_to_emacs (emacs_socket, " ");
>
> - retry:
> if (nowait)
> send_to_emacs (emacs_socket, "-nowait ");
>
> @@ -2350,6 +2349,8 @@ main (int argc, char **argv)
> memmove (recv_buf, p, nrecv);
> }
>
> + free (cwd);
> +
> if (!skiplf && 0 <= process_grouping ())
> printf ("\n");
LGTM, and I think this is okay for the emacs-31 branch, thanks.
--
Sean Whitton
bug-gnu-emacs@HIDDEN:bug#81104; Package emacs.
Full text available.
Received: (at submit) by debbugs.gnu.org; 23 May 2026 01:08:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 22 21:08:47 2026
Received: from localhost ([127.0.0.1]:36378 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1wQar6-0005O2-2B
for submit <at> debbugs.gnu.org; Fri, 22 May 2026 21:08:47 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:55526)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1wQaqy-0005NK-SO
for submit <at> debbugs.gnu.org; Fri, 22 May 2026 21:08:40 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <dmitry@HIDDEN>) id 1wQaql-0003LK-GU
for bug-gnu-emacs@HIDDEN; Fri, 22 May 2026 21:08:25 -0400
Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <dmitry@HIDDEN>) id 1wQaqj-0000vF-Fp
for bug-gnu-emacs@HIDDEN; Fri, 22 May 2026 21:08:23 -0400
Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43])
by mailfhigh.phl.internal (Postfix) with ESMTP id 7AC7E14000E1
for <bug-gnu-emacs@HIDDEN>; Fri, 22 May 2026 21:08:11 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
by phl-compute-03.internal (MEProxy); Fri, 22 May 2026 21:08:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
:content-transfer-encoding:content-type:content-type:date:date
:from:from:in-reply-to:message-id:mime-version:reply-to:subject
:subject:to:to; s=fm2; t=1779498491; x=1779584891; bh=0PfiS5+mn9
aCDh1iW4YMjRpL0TUmNgPmgDvcrvQ2L7o=; b=RJtFr6MprAHcsQCoDbIq0xaoo0
6c85eTjAMIZavb56aA8Er4DBJgOWtZ3fJKyjajQ/Mi/shxHHh2OtjKcl9Ka7ab+7
sd2kKq+ePlm1pKZrJnLyogs2EnOXlGbpIubDMC1Rm9Lu2nNmMOn6QlUSxppaUqSy
LNbz0YFu83P3of86bHDClJE0VVkc1MuGChZd+8+MngYFiMbSkmrQ3lH5c8Dpgh8D
uSAQZXbag/L8JLm+oTjufK4pOBV2XfiR9ERRGOc7IQJxwF4A/85Rix3qc7f2s4cV
N6auOskxcr9rf+b5tCPrlOTMpqMI95vpeJSrry4qchX/I6SCqQkte+mXkBDQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:content-transfer-encoding:content-type
:content-type:date:date:feedback-id:feedback-id:from:from
:in-reply-to:message-id:mime-version:reply-to:subject:subject:to
:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=
1779498491; x=1779584891; bh=0PfiS5+mn9aCDh1iW4YMjRpL0TUmNgPmgDv
crvQ2L7o=; b=al4eyXcV6Uq1GhqGmyLfnyzlnXxiYnXFSzLjFzZtv5OISzsIwpG
YYk0Yb8aXLX/bMMAnSyl6ZHpCSlMVaCK6IKBMFq+DIyB9EjpHMe3Ny67D2crfRSy
rbFY3hgosb7ncECwTzVL1XvS9+ANk5buDr/67DKXj6EcErLt8C0VOXA5f8QiZMeb
IL7nTnwBRyjX9764ThHrL9pIwyBZ5aq73BntTCxhCp+vFYAtywONAP5/KdXiTrJw
esli+BPU2OITBPpjTojzkVKYj3ehsISDyDMAHwFQKzBohS3RYgonhVjL5bEfkl8p
4x6aDRBfd5uaFHtI8HDu57Oks63g3H3yGlQ==
X-ME-Sender: <xms:-_0QahBBHAEpybdqnj16RU7esJ8k4nVyIj47-DkIqaJ0Ne6gLHJ3Xg>
<xme:-_0Qalal2SgAZ31Hu-izp3v-XN3JHF8OkBK4Z5nxTJz0or6yRZXtUzIsi8GBmkKeF
Iv_vL0MVutgwIme-TF_BebboaAGc86J2oW6whwA3965gM6fsArwHk67>
X-ME-Received: <xmr:-_0Qanp2L_cIHE6mrNzdA-3MS2jm-J7FUphU_5Y0_SVlgGKoiuQutOG-QfYzDP1buYO->
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduheduieelucetufdoteggodetrf
dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
rghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfvhffutgfgsehtjeertddtvd
ejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdr
uggvvheqnecuggftrfgrthhtvghrnhepfeekfeeghfejveehkedtgefhffejgefgudetgf
eguefhteekudeivefghfekgfevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm
pehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtth
hopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgr
tghssehgnhhurdhorhhg
X-ME-Proxy: <xmx:-_0Qaokiv45jEE3CrcrgblQGzCmSjKvqu2F0IKs3yW7PgvafUgm7jQ>
<xmx:-_0Qap0116CCKXwQbAFA5GpaQzkKnSOjgF7nMcsrNuCcF1Mz2Da2pg>
<xmx:-_0QagBj_tA7Ye6CMW7W_rfrdDOLlFOFof6lZ78DNgtQVOVZZ3S_Fw>
<xmx:-_0QamwcZ267D3G1ge0iSDJjX3cxk1pugDezXkBdDCicWX0_CN7uYA>
<xmx:-_0QajSnMeQ8hkrdDEVTR8CGJcBb-rYOhLUf-7AM6Mmb_5hKxd1r_i2I>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
<bug-gnu-emacs@HIDDEN>; Fri, 22 May 2026 21:08:10 -0400 (EDT)
Message-ID: <01d5a708-bb81-4cb7-8e24-2a4f60a779fc@HIDDEN>
Date: Sat, 23 May 2026 04:08:09 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: bug-gnu-emacs@HIDDEN
From: Dmitry Gutov <dmitry@HIDDEN>
Subject: Buggy file name when emacsclient fails over to terminal twice
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=103.168.172.156; envelope-from=dmitry@HIDDEN;
helo=fhigh-a5-smtp.messagingengine.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001,
SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)
To reproduce, start the daemon and launch emacsclient with faulty -d
parameter (which makes it fail over to running in terminal) and a file
name that includes a directory part, twice.
1. src/emacs --daemon
2. lib-src/emacsclient -d :99 -c admin/find-gc.el
3. lib-src/emacsclient -d :99 -c admin/find-gc.el # again
The second time the client visits admin/admin/find-gc.el, which does not
exist - so I get an empty buffer.
Reproduces now and in Emacs 30 too (haven't tried versions older).
Proposed fix below:
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 0769c94a89d..065243d46ef 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -2066,15 +2066,14 @@ main (int argc, char **argv)
send_to_emacs (emacs_socket, " ");
}
}
+ retry:
send_to_emacs (emacs_socket, "-dir ");
if (tramp_prefix)
quote_argument (emacs_socket, tramp_prefix);
quote_argument (emacs_socket, cwd);
- free (cwd);
send_to_emacs (emacs_socket, "/");
send_to_emacs (emacs_socket, " ");
- retry:
if (nowait)
send_to_emacs (emacs_socket, "-nowait ");
@@ -2350,6 +2349,8 @@ main (int argc, char **argv)
memmove (recv_buf, p, nrecv);
}
+ free (cwd);
+
if (!skiplf && 0 <= process_grouping ())
printf ("\n");
Dmitry Gutov <dmitry@HIDDEN>:bug-gnu-emacs@HIDDEN.
Full text available.bug-gnu-emacs@HIDDEN:bug#81104; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.