Prechádzať zdrojové kódy

don't trim e+20 into e+2 (trac https://trac.osgeo.org/grass/ticket/720; incurs a 2.5% performance hit; merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38855 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 15 rokov pred
rodič
commit
8d9e430c54
1 zmenil súbory, kde vykonal 5 pridanie a 0 odobranie
  1. 5 0
      lib/gis/trim_dec.c

+ 5 - 0
lib/gis/trim_dec.c

@@ -11,6 +11,7 @@
  * \author Original author CERL
  */
 
+#include <string.h>
 #include <grass/gis.h>
 
 /*!
@@ -24,6 +25,10 @@ void G_trim_decimal(char *buf)
 {
     char *mark;
 
+    /* don't trim e+20 into e+2 */
+    if( strchr(buf, 'e') || strchr(buf, 'E') )
+	return 0;
+
     /* find the . */
     while (*buf != '.')
 	if (*buf++ == 0)