delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/02/02/02:41:20

Delivered-To: listarch-cygwin-developers AT sourceware DOT cygnus DOT com
Date: Mon, 1 Feb 1999 21:17:11 -0500
Message-Id: <199902020217.VAA06515@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: cgf AT cygnus DOT com
CC: noer AT cygnus DOT com, fujieda AT jaist DOT ac DOT jp, cygwin32-developers AT cygnus DOT com
In-reply-to: <19990201202319.B29435@cygnus.com> (message from Christopher
Faylor on Mon, 1 Feb 1999 20:23:19 -0500)
Subject: Re: Mount improvements finished
References: <19990127144716 DOT B9708 AT cygnus DOT com> <wksocs9747 DOT fsf AT indra DOT will DOT or DOT jp> <199901310017 DOT TAA00964 AT envy DOT delorie DOT com> <19990201011721 DOT A18257 AT cygnus DOT com> <19990201202319 DOT B29435 AT cygnus DOT com>
Sender: owner-cygwin32-developers AT cygnus DOT com

> I just checked in a change that causes the mounts to be
> internally sorted by decreasing length of the win32 path.
> 
> That seems to solve this particular problem.

Yes, but it causes the other problem - conversion from posix
to win32 will break.  Consider this sample mount table:

d:\cygwin	/
d:\		/dos/d

When converting from win32 paths to posix paths, the mount table must
be sorted by win32 paths, longest first.  However, when converting
from a posix path to a win32 paths, the mount table must be sorted by
posix paths, longest first.  It is impossible for one sorting to cover
both cases.  Consider the following example conversions (using the
table entries in the order given above):

d:\cygwin\bin	/bin			right
		/dos/d/cygwin/bin	wrong (but works)

/dos/d/foo	d:\cygwin\dos\d\foo	wrong
		d:\foo			right

In both cases, the right one is the one that matches the longest (thus
most specific) directory *of that type* (win32 vs posix).  If you used
a single sorting, one of the above cases would always be wrong.

If we are to use the sort shortcut, we must maintain two sortings, one
of which may simply be an array of pointers to the other's records.

- Raw text -


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