diff options
author | Gary E. Miller <gem@rellim.com> | 2005-08-19 05:48:28 +0000 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2005-08-19 05:48:28 +0000 |
commit | cf94c059381e76e00134696991b6aa0d04e01339 (patch) | |
tree | 6ca1de60677610d7ba18b1df019a80d0e9b937e6 /libgps.c | |
parent | a5f12a958510a08165a8ca38c76eb6b19ad60e6f (diff) | |
download | gpsd-cf94c059381e76e00134696991b6aa0d04e01339.tar.gz |
GPSD_UNITS now sets proper units in cgps.
Diffstat (limited to 'libgps.c')
-rw-r--r-- | libgps.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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 */ |