This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Patch for path.cc & environ.cc


Carl Thompson [cet@carlthompson.net] writes:

> OK, switch HOME to something like GNOMOVISION_DIR.  Lot's of software does
> that.  Or does Cygwin convert all paths found in the environment?

I'm not sure there would be a need, nor that even HOME would be a problem in
the original example.

Let's say that GNOMOVISION_DIR was set to "C:\Program Files\Gnomovision",
and then the code took that setting and added "/somedirectory/somefile" to
it.  Now, there's no problem using mixed separators - that'll work fine.
But because it has a \ in it, Cygwin will assume it's a window path and not
use the mount settings.  But that's what you want in this case -
GNOMOVISION_DIR _is_ a Windows path.  Conversely if it just had "/" then you
can configure and treat it as a Cygwin path.

The same would even hold true for HOME - although with HOME, given that it's
something that Unix utilities may depend on, is translated into a
Cygwin/POSIX path, so that a typical Unix application wouldn't have to deal
with any Window-isms in the setting (e.g., not expect to find backslashes
there).

I think the only time the behavior may create issues is if you have a path
using \, but which really wants to reference the Cygwin mount locations.
But it seems somewhat strange that someone thinking of a Unix filesystem and
Cygwin mounts would ever choose to use \.  That's not the same as saying an
NT user with Cygwin apps never uses a path with a \ in it, only that when
doing so, it's more likely the path really is a Windows path.

About the only real risk I can see is a Cygwin application using /
consistently, but then getting user input (or configured input perhaps) for
a suffix on a path that uses \, since that would change the specification.
This is different than a full path (or prefix) since in that case treating
the root of the path per-Windows would be fine.  But I'm not sure how Cygwin
could reliably handle that case, and since the application in question would
be Unix oriented (else why build with Cygwin) it should be expecting / from
the user/config I expect.

-- David

/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l@fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]