From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.lisp.guile.bugs Subject: bug#10474: Building guile 2.x under mingw + msys Date: Tue, 19 Feb 2013 19:53:57 +0200 Message-ID: <83bobgp4ui.fsf@gnu.org> References: <87pqerdxq4.fsf@pobox.com> <83ehuy698u.fsf@gnu.org> <8362ga5h7h.fsf@gnu.org> <87r4ywpnv0.fsf@gnu.org> <83r4yw49u6.fsf@gnu.org> <87y5smnj86.fsf@pobox.com> <83ehudp29y.fsf@gnu.org> <87sj4s7fcc.fsf@pobox.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1361296523 7304 80.91.229.3 (19 Feb 2013 17:55:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Feb 2013 17:55:23 +0000 (UTC) Cc: ludo@gnu.org, 10474@debbugs.gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Feb 19 18:55:45 2013 Return-path: Envelope-to: guile-bugs@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 1U7rPn-00047w-Fy for guile-bugs@m.gmane.org; Tue, 19 Feb 2013 18:55:39 +0100 Original-Received: from localhost ([::1]:35788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7rPS-00057U-Ix for guile-bugs@m.gmane.org; Tue, 19 Feb 2013 12:55:18 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7rPC-0004i6-By for bug-guile@gnu.org; Tue, 19 Feb 2013 12:55:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7rP7-0004N9-46 for bug-guile@gnu.org; Tue, 19 Feb 2013 12:55:02 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7rP6-0004Mr-VB for bug-guile@gnu.org; Tue, 19 Feb 2013 12:54:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U7rQA-0000q5-Dh for bug-guile@gnu.org; Tue, 19 Feb 2013 12:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 19 Feb 2013 17:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10474 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 10474-submit@debbugs.gnu.org id=B10474.13612965253179 (code B ref 10474); Tue, 19 Feb 2013 17:56:02 +0000 Original-Received: (at 10474) by debbugs.gnu.org; 19 Feb 2013 17:55:25 +0000 Original-Received: from localhost ([127.0.0.1]:37267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7rPZ-0000pE-05 for submit@debbugs.gnu.org; Tue, 19 Feb 2013 12:55:25 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:57105) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7rPW-0000p5-Ex for 10474@debbugs.gnu.org; Tue, 19 Feb 2013 12:55:23 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MIH00300A8KDH00@a-mtaout21.012.net.il> for 10474@debbugs.gnu.org; Tue, 19 Feb 2013 19:53:48 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MIH0037XB1MC660@a-mtaout21.012.net.il>; Tue, 19 Feb 2013 19:53:46 +0200 (IST) In-reply-to: <87sj4s7fcc.fsf@pobox.com> X-012-Sender: halo1@inter.net.il 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.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6758 Archived-At: > From: Andy Wingo > Cc: ludo@gnu.org, 10474@debbugs.gnu.org > Date: Tue, 19 Feb 2013 11:44:35 +0100 > > > . module/ice-9/boot-9.scm -- absolute-path? does not support Windows > > file names with drive letters. Windows > > absolute file names match the regex > > "\([a-zA-Z]:\)?[\\/]". I don't know > > Scheme well enough to write this in a > > clean way, sorry... > > Ludo, what do you think about the attached patch? Eli, is it correct > and sufficient to fix path handling? Yes, I think so. I have a couple of comments, though: > + (define (unc-path?) > + ;; Universal Naming Convention (UNC) paths start with \\, and > + ;; are always absolute. > + (string-prefix? "\\\\" path)) A UNC file name can also begin with 2 slashes, as in "//foo/bar/". In general, Windows system calls treat both kinds of slashes identically. > (define (canonical->suffix canon) > (cond > - ((string-prefix? "/" canon) canon) > - ((and (> (string-length canon) 2) > - (eqv? (string-ref canon 1) #\:)) > - ;; Paths like C:... transform to /C... > - (string-append "/" (substring canon 0 1) (substring canon 2))) > + ((and (not (string-null? canon)) > + (path-separator? (string-ref canon 0))) > + canon) > + ((and (eq? (system-path-convention) 'windows) > + (absolute-path? canon)) > + ;; An absolute path that doesn't start with a path separator starts with a > + ;; drive component. Transform the drive component to a path element: > + ;; c:\foo -> \c\foo. Why is this transformation needed? Native Windows system calls will not understand "/c/foo" syntax. What is this about? (I know it was in the original code, but I didn't understand it then, either.)