bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glob on Windows systems


From: Bruno Haible
Subject: Re: glob on Windows systems
Date: Sat, 9 Jan 2010 13:04:20 +0100
User-agent: KMail/1.9.9

Hi John,

John W. Eaton wrote:
> Looking at lib/glob.c in the gnulib sources, there is some
> Windows-specific code, so it looks like it is intended to work on
> Windows systems

> Is glob.c expected to work on Windows systems?

At least it passes its unit test on mingw.

> but there are some things that don't look quite 
> right.  For example, it does not seem to uniformly use backslash as a
> directory separator

Probably this is because backslash is used as an escape character, if
GLOB_NOESCAPE is not specified among the flags.

> Should it accept \, /, or both as the directory separator?  I suppose if
> it allows \ as the directory separator, then GLOB_NOESCAPE would
> always have to be set.

You say it.

> and if WINDOWS32 is defined, it looks for 
> HOMEDRIVE and HOMEPATH instead of calling some Windows API function

That's the old Windows95 way of doing it, but it works also on Windows XP.
On Windows XP, you can also do getenv("USERPROFILE").

> (maybe GetUserProfileDirectory?).

This would work as well. But why call a function that requires linking
with userenv.dll [1], when you can get the same information with getenv?

Bruno

[1] http://msdn.microsoft.com/en-us/library/bb762280(VS.85).aspx




reply via email to

[Prev in Thread] Current Thread [Next in Thread]