caf825
Subject: getdoublearr.stripwhite
caf825
From: Michel Normand <normand@fr.ibm.com>
caf825
caf825
GetDoubleArr must only handle the comma delimited list at string head
caf825
and ignore anything after the first blank character.
caf825
caf825
Signed-off-by: Michel Normand <normand@fr.ibm.com>
caf825
---
caf825
 ATLAS/include/atlas_genparse.h |   16 ++++++++++++++--
caf825
 1 file changed, 14 insertions(+), 2 deletions(-)
caf825
caf825
Index: atlas/ATLAS/include/atlas_genparse.h
caf825
===================================================================
caf825
--- atlas.orig/ATLAS/include/atlas_genparse.h
caf825
+++ atlas/ATLAS/include/atlas_genparse.h
caf825
@@ -149,13 +149,24 @@ static int asmNames2bitfield(char *str)
caf825
 }
caf825
 
caf825
 /* procedure 7 */
caf825
-static int GetDoubleArr(char *str, int N, double *d)
caf825
+static int GetDoubleArr(char *callerstr, int N, double *d)
caf825
 /*
caf825
  * Reads in a list with form "%le,%le...,%le"; N-length d recieves doubles.
caf825
  * RETURNS: the number of doubles found, or N, whichever is less
caf825
  */
caf825
 {
caf825
-   int i=1;
caf825
+   int i;
caf825
+   char *dupstr = DupString(callerstr);
caf825
+   char *str = dupstr;
caf825
+   /* strip the string to end on first white space */
caf825
+   for (i=0; dupstr[i]; i++)
caf825
+   {
caf825
+	if (isspace(dupstr[i])) {
caf825
+		dupstr[i] = '\0';
caf825
+		break;
caf825
+	}
caf825
+   }
caf825
+   i = 1;
caf825
    assert(sscanf(str, "%le", d) == 1);
caf825
    while (i < N)
caf825
    {
caf825
@@ -166,6 +177,7 @@ static int GetDoubleArr(char *str, int N
caf825
	break;
caf825
       i++;
caf825
    }
caf825
+   free(dupstr);
caf825
    return(i);
caf825
 }
caf825