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#49711: 27.2; Deleting a directory called ~ deletes home directory Date: Sat, 24 Jul 2021 15:40:30 +0300 Message-ID: <83fsw3zxz5.fsf@gnu.org> References: <87czr9j9ns.fsf@gnus.org> <8735s43pte.fsf@gnus.org> <83h7gjzz1c.fsf@gnu.org> <87im0z3niu.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10427"; mail-complaints-to="usenet@ciao.gmane.io" Cc: abdo.haji.ali@gmail.com, 49711@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 24 14:41:11 2021 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 1m7Gxq-0002Yh-PO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Jul 2021 14:41:10 +0200 Original-Received: from localhost ([::1]:35606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7Gxp-00083o-8e for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Jul 2021 08:41:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7Gxi-00083e-TI for bug-gnu-emacs@gnu.org; Sat, 24 Jul 2021 08:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m7Gxi-0002QD-M8 for bug-gnu-emacs@gnu.org; Sat, 24 Jul 2021 08:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m7Gxi-0006OX-HW for bug-gnu-emacs@gnu.org; Sat, 24 Jul 2021 08:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Jul 2021 12:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49711 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 49711-submit@debbugs.gnu.org id=B49711.162713045424556 (code B ref 49711); Sat, 24 Jul 2021 12:41:02 +0000 Original-Received: (at 49711) by debbugs.gnu.org; 24 Jul 2021 12:40:54 +0000 Original-Received: from localhost ([127.0.0.1]:45356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7GxZ-0006Nz-N5 for submit@debbugs.gnu.org; Sat, 24 Jul 2021 08:40:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7GxX-0006Nb-98 for 49711@debbugs.gnu.org; Sat, 24 Jul 2021 08:40:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39956) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7GxR-0002Nw-Tb; Sat, 24 Jul 2021 08:40:45 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2350 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 1m7GxR-000159-IK; Sat, 24 Jul 2021 08:40:45 -0400 In-Reply-To: <87im0z3niu.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 24 Jul 2021 14:27:21 +0200) 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:210636 Archived-At: > From: Lars Ingebrigtsen > Cc: abdo.haji.ali@gmail.com, 49711@debbugs.gnu.org > Date: Sat, 24 Jul 2021 14:27:21 +0200 > > Eli Zaretskii writes: > > > Hmm... you replaced expand-file-name with directory-append, but what > > if there's a real "~" in the arguments, or some ".." etc. stuff? That > > would now wind up in the trash info, no? > > Sorry, I don't follow you here -- if we're trashing a file called > "/tmp/~", then the "~" file ends up in the trash now, as expected. > > Do you mean "~/foo"? That works the same as before. Does it? And what gets recorded in the trash info -- "~/foo" or its expansion? If the latter, where does that expansion happen? And what about relative file names, as in "foo/bar" -- what gets recorded in trash info then? > (Moving "/tmp/.." to trash fails the same way as before.) What about /foo/bar/../baz/../quux/something -- what gets recorded in trash info? Btw, the implementation of directory-append is sub-optimal: it allocates space for the combined string twice. It is better to create an uninit Lisp string first, and then fill its data with the right contents.