From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#6299: In read-file-name: (args-out-of-range "c:" 0 3) Date: Sun, 30 May 2010 02:10:38 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1275179302 11652 80.91.229.12 (30 May 2010 00:28:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 30 May 2010 00:28:22 +0000 (UTC) Cc: 6299@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 30 02:28:21 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OIWO2-0006H4-Ol for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 May 2010 02:28:19 +0200 Original-Received: from localhost ([127.0.0.1]:46937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIWO1-0005pJ-Sv for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 May 2010 20:28:17 -0400 Original-Received: from [140.186.70.92] (port=41177 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIWNO-0005OU-1p for bug-gnu-emacs@gnu.org; Sat, 29 May 2010 20:27:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIWNL-0007ad-Vb for bug-gnu-emacs@gnu.org; Sat, 29 May 2010 20:27:37 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60674) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIWNL-0007aY-UL for bug-gnu-emacs@gnu.org; Sat, 29 May 2010 20:27:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OIW8I-0005z3-UO; Sat, 29 May 2010 20:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 May 2010 00:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6299 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6299-submit@debbugs.gnu.org id=B6299.127517826722987 (code B ref 6299); Sun, 30 May 2010 00:12:02 +0000 Original-Received: (at 6299) by debbugs.gnu.org; 30 May 2010 00:11:07 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIW7O-0005yi-3u for submit@debbugs.gnu.org; Sat, 29 May 2010 20:11:07 -0400 Original-Received: from mail-yw0-f183.google.com ([209.85.211.183]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIW7L-0005yM-SU for 6299@debbugs.gnu.org; Sat, 29 May 2010 20:11:04 -0400 Original-Received: by ywh13 with SMTP id 13so1593178ywh.8 for <6299@debbugs.gnu.org>; Sat, 29 May 2010 17:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=jrH5smU/yL7Kfu/RHZVWQrupu8qgUBNsnzZ4LefwjfQ=; b=ZyJKlJDcM7FsCO5WCeYgTK9IheIZmZvfAPnoel4t/nWBJ38snTB6dDk7Lh2HdQuSXF J70HjMhD8BevUliXr21zEdMlsye8QuccOT2VRz/4QNnneCiN0IoH7Me9IEFWBBIlGVgp yP5ULVfJKx7i11Lqxke+QhkYC15MPNn0l3K0c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=lYltw1gB24mYlt/tUms0GpQMTNPMMPpACQWdHOAzlqzugWypUIDiFmZCACDSXy3pA+ C9RCXZAse5iKoQ6znx2/GLMfQIMrHv/kgVvSqQW9jWlVzh4cNzkPjv6ogBLBqnvqaiBn y2psx4Wi4R57X0V6OkWeD3zBU+V1uVpCvj6pw= Original-Received: by 10.100.245.40 with SMTP id s40mr2898216anh.137.1275178258180; Sat, 29 May 2010 17:10:58 -0700 (PDT) Original-Received: by 10.100.44.20 with HTTP; Sat, 29 May 2010 17:10:38 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 29 May 2010 20:12:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37406 Archived-At: On Sun, May 30, 2010 at 1:29 AM, Stefan Monnier wrote: >> BOUNDARIES string=3D"c:" table=3Dread-file-name-internal pred=3Dfile-exi= sts-p suffix=3D"" >> BOUNDARIES boundaries=3D(boundaries 3) > > This appears to be the problem. > > =C2=A0(read-file-name-internal "c:" nil '(boundaries . "")) > > seems to return (boundaries 3 . 0). > Since the code that does that is most likely the one in > completion--file-name-table which does: > > =C2=A0 =C2=A0(let ((start (length (file-name-directory string))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end (string-match-p "/" (cdr action)))= ) > =C2=A0 =C2=A0 =C2=A0(list* 'boundaries start end))) > > my guess is that (file-name-directory "c:") return "c:/". Yes, that is the case, it returns "c:/". But I think that is can't return something. However in my opinion it should return an error because "c:" is not a file path. It is just a device. It it signaled an error code that tries something like this would be more easily found and cured. So I think the problem is that (file-name-directory "c:") is called. There must be some bad assumption somewhere in the code behind that. Another suggestion that might help cleaning the code logic in different places: Add a function directory-root-p w32: (directory-root-p "c:/") =3D> t *nix: (directory-root-p "/") =3D> t w32: (directory-root-p "/") =3D> nil (or signal error, but that would fit badly with file-directory-p) *nix: (directory-root-p "c;/") =3D> nil -"- > I guess we should just use (or (string-match "[^/]*\\'" string) 0) > instead of (length (file-name-directory string)) but it has N^2 > complexity :-( > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0Stefan >