[GRASS-SVN] r60466 - grass/trunk/lib/db/dbmi_base

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 24 14:09:16 PDT 2014


Author: martinl
Date: 2014-05-24 14:09:16 -0700 (Sat, 24 May 2014)
New Revision: 60466

Modified:
   grass/trunk/lib/db/dbmi_base/login.c
Log:
db_get_login(): database can be NULL (ignored)


Modified: grass/trunk/lib/db/dbmi_base/login.c
===================================================================
--- grass/trunk/lib/db/dbmi_base/login.c	2014-05-24 21:08:38 UTC (rev 60465)
+++ grass/trunk/lib/db/dbmi_base/login.c	2014-05-24 21:09:16 UTC (rev 60466)
@@ -221,7 +221,7 @@
   is not found, user/password are set to NULL
   
   \param driver driver name
-  \param database database name
+  \param database database name (can be NULL)
   \param[out] user name
   \param[out] password string
   
@@ -246,7 +246,7 @@
 
     for (i = 0; i < login.n; i++) {
 	if (strcmp(login.data[i].driver, driver) == 0 &&
-	    strcmp(login.data[i].database, database) == 0) {
+	    (!database || strcmp(login.data[i].database, database) == 0)) {
 	    if (login.data[i].user && strlen(login.data[i].user) > 0)
 		*user = G_store(login.data[i].user);
 	    else



More information about the grass-commit mailing list