commit 624fc093e466f3212c86b43c5c075d4dab4e7cb2
parent f0ce778802282cf562c84305095fdcccba368f9f
Author: Christoph Lohmann <20h@r-36.net>
Date: Thu, 23 Oct 2014 16:37:17 +0200
Fix geo URI handling.
Now lon,lat is parsed correctly.
Diffstat:
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/limestone.cpp b/limestone.cpp
@@ -37,12 +37,12 @@ parseposition(char *s, float *lat, float *lon, float *alt)
if (s2 != NULL)
*s2++ = '\0';
- if (lat != NULL) {
- *lat = strtof(s, NULL);
+ if (lon != NULL) {
+ *lon = strtof(s, NULL);
isgood++;
}
- if (lon != NULL && s1 != NULL) {
- *lon = strtof(s1, NULL);
+ if (lat != NULL && s1 != NULL) {
+ *lat = strtof(s1, NULL);
isgood++;
}
if (alt != NULL && s2 != NULL)
@@ -217,11 +217,14 @@ main(int argc, char *argv[])
uscheme = qurl.scheme().toUtf8().data();
upath = qurl.path().toUtf8().data();
- if (!strcmp(uscheme, "worldview")) {
+ printf("scheme: %s\n", uscheme);
+ printf("path: %s\n", upath);
+
+ if (!strncmp(uri, "worldview:", 10)) {
if (parseposition(upath+1, &lat, &lon, &alt))
usage();
doposition = true;
- } else if(!strcmp(uscheme, "geo")) {
+ } else if(!strncmp(uri, "geo:", 4)) {
if (parseposition(upath, &lat, &lon, &alt))
usage();
doposition = true;