From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ramkumar Ramachandra Newsgroups: gmane.emacs.devel Subject: Re: [BUG] Not following symlinks by default Date: Sun, 28 Jul 2013 17:32:46 +0530 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1375013012 27902 80.91.229.3 (28 Jul 2013 12:03:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jul 2013 12:03:32 +0000 (UTC) Cc: =?UTF-8?B?RHV5IE5ndXnhu4Vu?= To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 28 14:03:35 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V3PhG-0006ZT-TQ for ged-emacs-devel@m.gmane.org; Sun, 28 Jul 2013 14:03:35 +0200 Original-Received: from localhost ([::1]:54900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3PhG-0000Pi-HX for ged-emacs-devel@m.gmane.org; Sun, 28 Jul 2013 08:03:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3PhB-0000PN-TC for emacs-devel@gnu.org; Sun, 28 Jul 2013 08:03:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3Ph9-00054M-G9 for emacs-devel@gnu.org; Sun, 28 Jul 2013 08:03:29 -0400 Original-Received: from mail-oa0-x233.google.com ([2607:f8b0:4003:c02::233]:41756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3Ph9-00054I-AP for emacs-devel@gnu.org; Sun, 28 Jul 2013 08:03:27 -0400 Original-Received: by mail-oa0-f51.google.com with SMTP id i4so11123745oah.10 for ; Sun, 28 Jul 2013 05:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=SLWT1GRZPCjnJBsggT933Mb4tmtlhn6KCyB2gn4znd0=; b=qsprJy8tvB6cBM2ZYLqqplWON7/BezB3dWVuALtogizUxQB1BD9l20tyMAnECJFRXs 5yTCqJ1ni1lhgYqVqfjAuHtx2W/eDz9si5ycYkOiWT1Nc9oRtGFRoTdndHr5PHmgCP2a /FpZxxCWhTF9qF7l6nb8QdAAfN7Hq2VCib0kcQ+nVW9iF20Gcy2dhuLF9xaSyMBy0Kpt 7h6V/tJz9fpfHsGRPTTyPYBBP9QXe96YZNCeLTTfa57ZNHiFWLhM5TMYcE7O5rsszqIq 2QMd9cWSW0SFfxkCAIgw38UWoj2cVK2uReBt3jmXR1D1L2VdJCs1bTVj3D/5mZtGeN3L 1ZPw== X-Received: by 10.42.76.5 with SMTP id c5mr21349860ick.91.1375013006712; Sun, 28 Jul 2013 05:03:26 -0700 (PDT) Original-Received: by 10.64.37.130 with HTTP; Sun, 28 Jul 2013 05:02:46 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:162219 Archived-At: Ramkumar Ramachandra wrote: > #!/bin/sh > > cd /tmp > rm -rf z b > mkdir z z/a z/b > echo ha >z/a/file > ln -s z/b > cd b > cat ../a/file > emacs -Q ../a/file # buffer-file-name = /tmp/a/file > > Why doesn't emacs behave like cat or vim? Isn't this behavior a bad default? Okay, so expand-file-name defined in src/fileio.c is buggy: #!/bin/sh cd /tmp rm -rf z b mkdir z z/a z/b ln -s z/b cd b emacs -Q --batch --eval='(error (expand-file-name "../a"))' realpath "../a" Why such horribly convoluted logic? What could be more straightforward? https://github.com/git/git/blob/master/abspath.c#L34