[GRASS-SVN] r58633 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jan 6 17:34:26 PST 2014
Author: annakrat
Date: 2014-01-06 17:34:26 -0800 (Mon, 06 Jan 2014)
New Revision: 58633
Modified:
grass/trunk/lib/gis/proj3.c
Log:
libgis: fix G_units segfault when units are not identified; recognize metre as meter
Modified: grass/trunk/lib/gis/proj3.c
===================================================================
--- grass/trunk/lib/gis/proj3.c 2014-01-07 00:39:17 UTC (rev 58632)
+++ grass/trunk/lib/gis/proj3.c 2014-01-07 01:34:26 UTC (rev 58633)
@@ -57,9 +57,11 @@
if (!name)
return plural ? _("units") : _("unit");
- if (strcasecmp(name, "meter") == 0 || strcasecmp(name, "meters") == 0)
+ if (strcasecmp(name, "meter") == 0 || strcasecmp(name, "metre") == 0
+ || strcasecmp(name, "meters") == 0 || strcasecmp(name, "metres") == 0)
units = U_METERS;
- else if (strcasecmp(name, "kilometer") == 0 || strcasecmp(name, "kilometers") == 0)
+ else if (strcasecmp(name, "kilometer") == 0 || strcasecmp(name, "kilometre") == 0
+ || strcasecmp(name, "kilometers") == 0 || strcasecmp(name, "kilometres") == 0)
units = U_KILOMETERS;
else if (strcasecmp(name, "acre") == 0 || strcasecmp(name, "acres") == 0)
units = U_ACRES;
@@ -72,7 +74,7 @@
else if (strcasecmp(name, "degree") == 0 || strcasecmp(name, "degrees") == 0)
units = U_DEGREES;
else
- units = U_UNDEFINED;
+ units = U_UNKNOWN;
}
return G_get_units_name(units, plural, FALSE);
More information about the grass-commit
mailing list