delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/06/10:32:30

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <4.3.1.2.20020506102515.0258e478@pop.ma.ultranet.com>
X-Sender: lhall AT pop DOT ma DOT ultranet DOT com
Date: Mon, 06 May 2002 10:29:41 -0400
To: "Christopher Murray" <CJM4 AT nrc DOT gov>, <cygwin AT cygwin DOT com>
From: "Larry Hall (RFK Partners, Inc)" <lhall AT rfk DOT com>
Subject: Re: canonpath in perl as it relates to cygwin
In-Reply-To: <scd65601.074@nrcgwia.nrc.gov>
Mime-Version: 1.0

At 10:07 AM 5/6/2002, Christopher Murray wrote:
>As it currently stands, canonpath will not strip out multiple occurrences of // in file paths when the script is executed from
>within a cygwin shell.  The relevant line from /usr/lib/perl5/5.6.1/File/Spec/Unix.pm that strips out multiple /'s is 
>
>$path =~ s|/+|/|g unless ($^O eq 'cygwin');
>
>I assume this regexp substitution is ignored for cygwin because we would not want to munge instances where // refers 
>to a network share (something regular unix doesn't need to worry about), but is it wise to also ignore all multiple forward
>slashes when they occur in the middle of a path?  Or is this simply a non-issue because, for the most part, it seems like 
>most (if not all?)  programs don't really seem to care about multiple path separators?


Right.  A sequence of multiple path separators is condensed into 1 for all 
but the first.  There the convention is to do something that is application
specific.



>For what it's worth, canonpath in ExtUtils::MM_Unix (and MM_Cygwin), uses
>
>$path =~ s|(?<=[^/])/+|/|g;
>
>which seems to do what I expect (leaves // at the front of a path alone, but replaces all remaining // with /).  The only weakness I see with this is that it will not replace ///shareName/path with //shareName/path, but that is a minor matter, at least as it concerns me.


Sorry, can't help here.  Reading complex regular expressions hurts my
head! ;-)


Larry Hall                              lhall AT rfk DOT com
RFK Partners, Inc.                      http://www.rfk.com
838 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019