all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: abdo.haji.ali@gmail.com, 49711@debbugs.gnu.org
Subject: bug#49711: 27.2; Deleting a directory called ~ deletes home directory
Date: Sat, 24 Jul 2021 15:40:30 +0300	[thread overview]
Message-ID: <83fsw3zxz5.fsf@gnu.org> (raw)
In-Reply-To: <87im0z3niu.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat,  24 Jul 2021 14:27:21 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: abdo.haji.ali@gmail.com,  49711@debbugs.gnu.org
> Date: Sat, 24 Jul 2021 14:27:21 +0200
> 
> Eli Zaretskii <eliz@gnu.org> 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.





  reply	other threads:[~2021-07-24 12:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 15:03 bug#49711: 27.2; Deleting a directory called ~ deletes home directory Al Haji-Ali
2021-07-23 16:07 ` Lars Ingebrigtsen
2021-07-23 17:08   ` Al Haji-Ali
2021-07-24 11:37     ` Lars Ingebrigtsen
2021-07-24 12:17       ` Eli Zaretskii
2021-07-24 12:27         ` Lars Ingebrigtsen
2021-07-24 12:40           ` Eli Zaretskii [this message]
2021-07-24 14:18             ` Lars Ingebrigtsen
     [not found]       ` <b5a28a7b-8705-41b1-8b48-4b042569b387@Spark>
2021-07-24 15:24         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83fsw3zxz5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=49711@debbugs.gnu.org \
    --cc=abdo.haji.ali@gmail.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.