aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/pool
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-04-19 20:55:56 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-04-19 20:55:56 +0000
commit2eaad01d335b72f78eb0d6344ac31fce46a82e68 (patch)
treea540a2e31d87ea6efe766b3dedbbf88351780449 /externals/grill/pool
parentdf0b641a8706a7ed912422b83be726b7f17cb82e (diff)
more symbol escaping
better method for discriminating numbers and symbols - by Frank Barknecht svn path=/trunk/; revision=2794
Diffstat (limited to 'externals/grill/pool')
-rw-r--r--externals/grill/pool/readme.txt1
-rw-r--r--externals/grill/pool/source/pool.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/externals/grill/pool/readme.txt b/externals/grill/pool/readme.txt
index 42103fa6..df5787c5 100644
--- a/externals/grill/pool/readme.txt
+++ b/externals/grill/pool/readme.txt
@@ -85,6 +85,7 @@ Version history:
- enhanced and optimized atom parsing
- escaped symbols (with \) for whitespace support on store and load
- escape symbols also with "" to help the load routine
+- improved reading of legacy data by Frank Barknecht
0.2.0:
- attributes (pool,private,echodir,absdir)
diff --git a/externals/grill/pool/source/pool.cpp b/externals/grill/pool/source/pool.cpp
index 23f5edbc..c2c0de6a 100644
--- a/externals/grill/pool/source/pool.cpp
+++ b/externals/grill/pool/source/pool.cpp
@@ -514,7 +514,14 @@ static char *ReadAtom(char *c,A *a)
float fres;
// first try float
+#if 0
if(!issymbol && sscanf(tmp,"%f",&fres) == 1) {
+#else
+ char *endp;
+ // see if it's a float - thanks to Frank Barknecht
+ fres = (float)strtod(tmp,&endp);
+ if(!issymbol && !*endp && endp != tmp) {
+#endif
if(a) {
int ires = (int)fres; // try a cast
if(fres == ires)