From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#10489: 24.0.92; dired-do-copy may create infinite directory hierarchy Date: Mon, 16 Jan 2012 15:09:48 +0100 Message-ID: References: <87mx9su32g.fsf@web.de> <87lipcrlga.fsf@gmail.com> <87fwfkc4pn.fsf@gmx.de> <87fwfjsw8t.fsf@gmail.com> <87aa5rdazl.fsf@gmx.de> <87d3anogf5.fsf@gmail.com> <011AEED9E81C4DEFA6B1E03B0F57F28F@us.oracle.com> <878vlbljnc.fsf@gmx.de> <8739bj8mu1.fsf@gmail.com> <87fwfjo24c.fsf@gmx.de> <87pqen76p4.fsf@gmail.com> <83fwfik92e.fsf@gnu.org> <87mx9q1sz7.fsf@gmail.com> <87vcodm8ns.fsf@gmx.de> <87pqekopb5.fsf@gmail.com> <87hazwoost.fsf@gmail.com> <87ty3w9639.fsf@gmx.de> <8762gckckt.fsf@gmail.com> <87pqek9269.fsf@gmx.de> <87r4z0yqfx.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1326723026 29400 80.91.229.12 (16 Jan 2012 14:10:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2012 14:10:26 +0000 (UTC) Cc: 10489@debbugs.gnu.org, Michael Albinus To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 16 15:10:21 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RmnGO-00016i-1V for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Jan 2012 15:10:20 +0100 Original-Received: from localhost ([::1]:32956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmnGN-0003FB-6S for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Jan 2012 09:10:19 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmnGG-0003F0-M5 for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2012 09:10:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmnGC-00031m-E7 for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2012 09:10:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmnGC-00031M-2f for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2012 09:10:08 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RmnH4-0007jW-2G for bug-gnu-emacs@gnu.org; Mon, 16 Jan 2012 09:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Jan 2012 14:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10489 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10489-submit@debbugs.gnu.org id=B10489.132672304729701 (code B ref 10489); Mon, 16 Jan 2012 14:11:02 +0000 Original-Received: (at 10489) by debbugs.gnu.org; 16 Jan 2012 14:10:47 +0000 Original-Received: from localhost ([127.0.0.1]:59871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RmnGo-0007iz-8f for submit@debbugs.gnu.org; Mon, 16 Jan 2012 09:10:47 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.10]:55409) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RmnGm-0007ir-7h for 10489@debbugs.gnu.org; Mon, 16 Jan 2012 09:10:45 -0500 Original-Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id B7F231800158; Mon, 16 Jan 2012 15:09:48 +0100 (CET) X-Auth-Info: oULVVgKupZckrwgfv8+wSqy+pX91ICJrYSyq5YPP6Lw= Original-Received: from igel.home (ppp-93-104-158-219.dynamic.mnet-online.de [93.104.158.219]) by mail.mnet-online.de (Postfix) with ESMTPA id 9F3161C00148; Mon, 16 Jan 2012 15:09:48 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 501) id 58B1DCA299; Mon, 16 Jan 2012 15:09:48 +0100 (CET) X-Yow: Imagine--a WORLD without POODLES... In-Reply-To: <87r4z0yqfx.fsf@gmail.com> (Thierry Volpiatto's message of "Mon, 16 Jan 2012 09:58:10 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55786 Archived-At: Thierry Volpiatto writes: > Michael Albinus writes: > >> Thierry Volpiatto writes: >> >>> IMHO we should fix this bug for most use cases with a compare function >>> maybe not perfect in many points but ok for most basic usages. >>> The function shown by Drew and I put in last patch as you said isn't >>> sufficient and fail in many cases even on local filesystem: >>> >>> (defun bmkp-same-file-p (file1 file2) >>> "Return non-nil if FILE1 and FILE2 name the same file. >>> If either name is not absolute, then it is expanded relative to >>> `default-directory' for the test." >>> (and (equal (file-remote-p file1) (file-remote-p file2)) >>> (string= (file-truename (expand-file-name file1)) >>> (file-truename (expand-file-name file2))))) >>> >>> (bmkp-same-file-p "~/Test" "/home/thierry/Test/") => nil >> >> So it must be >> >> (string= (directory-file-name (file-truename (expand-file-name file1))) >> (directory-file-name (file-truename (expand-file-name file2)))))) > > So, any objections to apply my patch to trunk with these changes? You also need to check whether the target is a subdirectory of the source. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."