This is the mail archive of the 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]
Other format: [Raw text]

Path separator

I am looking to enhance SWISH-E ( )to support
Cygwin.  It builds and runs just fine, but internally the code takes a
configuration parameter and if it is a shell-command, converts all of
the "/" characters to "\".

For example, if IndexDir is set to "c:/swish-e/bin/", then
this gets converted to "c:\swish-e\bin\" and gets passed to

This works well for running within the Win32 environment, but causes
problems within Cygwin (Cannot execute "").

Currently the code simply has:

#ifdef _WIN32
    make_windows_path( cmd );

and make_windows_path() blindly replaces '/' for '\'.

I'd like to have one binary support both Cygwin and native Win32
environments.  Suggestions on the "cleanest" way?

I figure that I can either:
 - detect at runtime whether we're in Cygwin (how?)
 - use an environment variable to determine the appropriate path
separator (is there one?)

Thanks in advance,

Greg Fenton

Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).

Unsubscribe info:
Problem reports:

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