1 |
/* Common functions for each GNATS client. |
/* Common functions for each GNATS client. |
2 |
|
Copyright (C) 1994, 1995, 1999, 2000, 2002 Free Software Foundation, Inc. |
3 |
Copyright (C) 2001 Dan Martinez |
Copyright (C) 2001 Dan Martinez |
|
Copyright (C) 1994, 1995, 1999, 2000 Free Software Foundation, Inc. |
|
4 |
Contributed by Brendan Kehoe (brendan@cygnus.com). |
Contributed by Brendan Kehoe (brendan@cygnus.com). |
5 |
|
|
6 |
This file is part of GNU GNATS. |
This file is part of GNU GNATS. |
779 |
{ |
{ |
780 |
char *vals[5]; |
char *vals[5]; |
781 |
char *evar = getenv ("GNATSDB"); |
char *evar = getenv ("GNATSDB"); |
782 |
|
bool is_net_conn = databaseSpecIsNetConn (evar); |
783 |
|
|
784 |
if (evar == NULL || evar[0] == '\0' || databaseSpecIsNetConn (evar)) |
if (evar == NULL || evar[0] == '\0' || is_net_conn) |
785 |
{ |
{ |
786 |
if (*hostname == NULL) |
if (*hostname == NULL) |
787 |
{ |
{ |
909 |
*passwd = xstrdup ("*"); |
*passwd = xstrdup ("*"); |
910 |
} |
} |
911 |
|
|
912 |
if (*database == NULL) |
if (*database == NULL && ! is_net_conn) |
913 |
{ |
{ |
914 |
*database = xstrdup ("default"); |
*database = ((evar == NULL || evar[0] == '\0') |
915 |
|
? xstrdup ("default") |
916 |
|
: xstrdup (evar)); |
917 |
} |
} |
918 |
|
|
919 |
if (*port == -1) |
if (*port == -1) |