summaryrefslogtreecommitdiff
path: root/libgps.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2005-08-19 05:48:28 +0000
committerGary E. Miller <gem@rellim.com>2005-08-19 05:48:28 +0000
commitcf94c059381e76e00134696991b6aa0d04e01339 (patch)
tree6ca1de60677610d7ba18b1df019a80d0e9b937e6 /libgps.c
parenta5f12a958510a08165a8ca38c76eb6b19ad60e6f (diff)
downloadgpsd-cf94c059381e76e00134696991b6aa0d04e01339.tar.gz
GPSD_UNITS now sets proper units in cgps.
Diffstat (limited to 'libgps.c')
-rw-r--r--libgps.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libgps.c b/libgps.c
index d2b2096d..9c67eeea 100644
--- a/libgps.c
+++ b/libgps.c
@@ -20,9 +20,10 @@ extern char *strtok_r(char *, const char *, char **);
* clients should only call this if no user preference on the command line or
* Xresources
*
- * return 0 - Use miles/feet
- * 1 - Use knots/feet
- * 2 - Use km/meters
+ * return imperial - Use miles/feet
+ * nautical - Use knots/feet
+ * metric - Use km/meters
+ * unspecified - use compiled default
*
* In order check these environment vars:
* GPSD_UNITS one of:
@@ -47,13 +48,13 @@ enum unit gpsd_units(void)
char *envu = NULL;
if ((envu = getenv("GPSD_UNITS")) != NULL && *envu != '\0') {
- if (strcasecmp(envu, "imperial")) {
+ if (0 == strcasecmp(envu, "imperial")) {
return imperial;
}
- if (strcasecmp(envu, "nautical")) {
+ if (0 == strcasecmp(envu, "nautical")) {
return nautical;
}
- if (strcasecmp(envu, "metric")) {
+ if (0 == strcasecmp(envu, "metric")) {
return metric;
}
/* unrecognized, ignore it */