Re: [PATCH 04/40] Windows: Use the Windows style PATH separator ';'.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 29, 2008, 12:19 UTC
- Message-ID
- <alpine.LSU.1.00.0802291214160.22527@racer.site>
- In-Reply-To
- <47C7BAEE.2020408@gnu.org>
Hi,
On Fri, 29 Feb 2008, Paolo Bonzini wrote:
Show 17 quoted lines
> Johannes Sixt wrote: > > On Thursday 28 February 2008 10:25, Paolo Bonzini wrote: > > > > +#ifdef __MINGW32__ > > > > + strbuf_addch(out, ';'); > > > > +#else > > > > strbuf_addch(out, ':'); > > > > +#endif > > > Why not adding a PATH_SEPARATOR #define? > > > > Because IMO it is obfuscating: > > > > 1. When you read through the code and see PATH_SEPARATOR, you still have > > to go look how it's defined. Why? Because you always will ask: Is this about > > ':' vs. ';' or '/' vs. '\\'? > > One is a DIR_SEPARATOR, the other is a PATH_SEPARATOR. It's a matter of > conventions.
I agree that it would be good, also for documentation purposes, to add the #defines.
However, there is something ugly waiting for us: we often have
case '/':
and for Windows, this needs to add
case '\\':
Now, we could #define CASE_DIR_SEPARATOR, which expands to "case '/': case '\\':" on Windows, but I am prepared to let Windows uglify our source code only so far *does the famous imitation of Linus where he puts two finger so close that you cannot see between them*.
Ciao, Dscho