Fossil SCM
Slightly improve clarity of the db_database_slot() function.
Commit
a12d712203e055c6b9864c2c80e509efd91f437a
Parent
569f4b0e04fb8ff…
1 file changed
+1
-1
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -987,11 +987,11 @@ | ||
| 987 | 987 | ** Return -1 if zLabel does not match any open database. |
| 988 | 988 | */ |
| 989 | 989 | int db_database_slot(const char *zLabel){ |
| 990 | 990 | int iSlot = -1; |
| 991 | 991 | Stmt q; |
| 992 | - if( g.db==0 ) return -1; | |
| 992 | + if( g.db==0 ) return iSlot; | |
| 993 | 993 | db_prepare(&q, "PRAGMA database_list"); |
| 994 | 994 | while( db_step(&q)==SQLITE_ROW ){ |
| 995 | 995 | if( fossil_strcmp(db_column_text(&q,1),zLabel)==0 ){ |
| 996 | 996 | iSlot = db_column_int(&q, 0); |
| 997 | 997 | break; |
| 998 | 998 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -987,11 +987,11 @@ | |
| 987 | ** Return -1 if zLabel does not match any open database. |
| 988 | */ |
| 989 | int db_database_slot(const char *zLabel){ |
| 990 | int iSlot = -1; |
| 991 | Stmt q; |
| 992 | if( g.db==0 ) return -1; |
| 993 | db_prepare(&q, "PRAGMA database_list"); |
| 994 | while( db_step(&q)==SQLITE_ROW ){ |
| 995 | if( fossil_strcmp(db_column_text(&q,1),zLabel)==0 ){ |
| 996 | iSlot = db_column_int(&q, 0); |
| 997 | break; |
| 998 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -987,11 +987,11 @@ | |
| 987 | ** Return -1 if zLabel does not match any open database. |
| 988 | */ |
| 989 | int db_database_slot(const char *zLabel){ |
| 990 | int iSlot = -1; |
| 991 | Stmt q; |
| 992 | if( g.db==0 ) return iSlot; |
| 993 | db_prepare(&q, "PRAGMA database_list"); |
| 994 | while( db_step(&q)==SQLITE_ROW ){ |
| 995 | if( fossil_strcmp(db_column_text(&q,1),zLabel)==0 ){ |
| 996 | iSlot = db_column_int(&q, 0); |
| 997 | break; |
| 998 |