"Mel" == Mel Hatzis <address@hidden> writes:
Mel> I believe I have the latest code...version 1.42 of
Mel> client.c.
Yes, that's the version I've got, too.
Mel> The problem occurs around 13 lines from the bottom of
Mel> the scanEnv function...
Mel> if (*database == NULL)
Mel> {
Mel> *database = xstrdup ("default");
Mel> }
Mel> If you look closely, you'll note that even though the
Mel> env. variable is read, it is not used to initialize the
Mel> 'database' variable....and therefore, the lines I've
Mel> pasted above end up setting it to 'default'.
I see... It is even a bit more complicated:
If GNATSDB is a colon separated tuple of
hostname:portnumber:databasename:username:password
then "database" gets initialized, but not if it is the name of a
database listed in the "databases" file.
(The tuple format is described in the manual in "Environment
variables and GNATS tools" in chapter "The GNATS user tools". It
is probably intended for databases that must be accessed across
the net, but are not listed in the "databases" file.)
Even worse: I do not see how scanEnv deals with a *local*
database at all.
A workaround seems to be to specify the database name via option
--database or -d. This is passed to client_init_gnats(), then to
scanEnv(), and is left untouched.
I don't dare to change the code, because I do not know it good
enough to be sure not to break another place.
Hans-Albert