Browse Source

db.connect: use HOST_DIRSEP on Windows (only for dbf and sqlite driver)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59364 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 years ago
parent
commit
69b3be44c4
1 changed files with 12 additions and 0 deletions
  1. 12 0
      db/db.connect/main.c

+ 12 - 0
db/db.connect/main.c

@@ -152,6 +152,18 @@ int main(int argc, char *argv[])
                         *c = '\0';
                         sprintf(database, "%s%s%s", buf, G_mapset(), c + 7);
                     }
+#ifdef __MINGW32__
+                    if (strcmp(conn.driverName, "sqlite") == 0 |
+                        strcmp(conn.driverName, "dbf") == 0) {
+                        char *p;
+                        p = database;
+                        while(*p) {
+                            if (*p == '/')
+                                *p = HOST_DIRSEP;
+                            p++;
+                        }
+                    }
+#endif
                 }
                 else {
                     database[0] = '\0';