delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/07/16/14:36:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
To: cygwin AT cygwin DOT com
From: Shankar Unni <shankarunni AT netscape DOT net>
Subject: Re: UNC Pathname Handling within Applications
Date: Fri, 16 Jul 2004 11:36:10 -0700
Lines: 31
Message-ID: <cd976s$kjr$1@sea.gmane.org>
References: <20040715033232 DOT GP25893 AT eumel DOT yoo DOT local> <cd71s1$rbd$1 AT sea DOT gmane DOT org> <20040715233034 DOT GA3729 AT eumel DOT yoo DOT local>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: adsl-68-122-192-48.dsl.pltn13.pacbell.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Thunderbird/0.7.1 Mnenhy/0.6.0.101
In-Reply-To: <20040715233034.GA3729@eumel.yoo.local>

Thorsten Haude wrote:

> The path is also displayed at various places. The user might be
> surprised to see surplus slashes.

[Starting to drift OT, sorry..]

Who's generating the surplus slashes? Is this because of trailing "/" in 
paths, and you're internally compositing names somehow?

I thought the only names you would *show* to the user would be the names 
of editor buffers, etc., something which the user has already specified 
explicitly anyway. It's not like you're saying "nedit myfile", and 
you're searching all over the filesystem to locate myfile..

If the name is something the user is already specifying as a relative or 
absolute path, then there's no need to further normalize them.

If you *do* ever show to the user a path that nedit has composed itself 
(say, some property display, like "where is the foobar package that is 
automatically loaded?"), then the right thing is to only normalize *at 
the point where you do the composition*.

I.e. if you're doing "prefix + basename", then the only normalization 
should be between prefix and basename (i.e. strip trailing slashes (any 
kind) from prefix, and append a "known slash" and basename).

You shouldn't be doing any further normalization (e.g. /x/../y -> /y or 
any such), because if it *is* a synthesized name, then there's great 
value in knowing *how* the name was synthesized. Normalizing it loses 
this information.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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