git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64396 15284696-431f-4ddb-bdfa-cd5b030d7da7
@@ -65,6 +65,7 @@ int db__driver_open_database(dbHandle * handle)
db.name[0] = '\0'; /* re-init */
for (n = 0; n < no_tokens; n++) {
+ G_chop(tokens[n]);
G_debug(3, "tokens[%d] = %s", n, tokens[n]);
if (tokens[n][0] == '$') {
G_strchg(tokens[n], '$', ' ');
@@ -65,6 +65,9 @@ int describe_table(int tab, int *scols, int nscols, dbTable ** table)
else
col = i;
+ precision = 0;
+ scale = 0;
+
dcol = &(db.tables[tab].cols[col]);
column = db_get_table_column(*table, i);
@@ -259,6 +259,9 @@ int save_table(int t)
case DBF_DOUBLE:
dbftype = FTDouble;
break;
+ default:
+ G_warning("invalid/unsupported DBFFieldType");
+ break;
}
width = db.tables[t].cols[i].width;
@@ -49,6 +49,7 @@ int parse_conn(const char *str, CONNPAR * conn)
tokens = G_tokenize(str, delm);
i = 0;
while (tokens[i]) {
+ G_chop(tokens[i]);
G_debug(3, "token %d : %s", i, tokens[i]);
if (strncmp(tokens[i], "host", 4) == 0) {
conn->host = G_store(tokens[i] + 5);
@@ -42,6 +42,7 @@ int replace_variables(char *in, char **datadir, char **database)
tmp[0] = '\0';
for (n = 0; n < no_tokens - 1; n++) {
if (n > 0)
strcat(tmp, "/");
@@ -181,6 +181,7 @@ int parse_sql_update(const char *sql, char **table, column_info **cols, int *nco
*cols = (column_info *)G_malloc(sizeof(column_info) * (*ncols));
for (n = 0; n < (*ncols); n++) {
+ G_chop(token[n]);
itoken = G_tokenize(token[n], "=");
if (G_number_of_tokens(itoken) != 2)
return FALSE;
@@ -44,6 +44,7 @@ int parse_conn(const char *str, PGCONN * pgconn)
if (strncmp(tokens[i], "host", 4) == 0)
pgconn->host = G_store(tokens[i] + 5);
@@ -60,6 +60,7 @@ int db__driver_open_database(dbHandle * handle)
name2[0] = '\0';
strcat(name2, "/");