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


Chris Faylor wrote:

> ...

> >If I am understanding you, there must be lots of software that
> >suffers from the same problem.  Think of all that Unix code that does
> >something like this:
> >
> >   char datafile[MAXPATHLEN] = "";
> >   const char* home = getenv("HOME");
> >   if (home) strncpy(datafile, home, sizeof(datafile));
> >   strncat(datafile, "/.GnomoVision/config", sizeof(datafile));
> >   [ Do something with filename ]
> >
> >If I understand correctly, wouldn't this run afoul of the problem if
> >the "HOME" environment variable were something like "C:\My Documents"
> >?  Or am I not getting it?
> 
> HOME is converted to POSIX format by Cygwin.

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

> cgf

Carl Thompson

--
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]