atlas/getdoublearr.stripwhite.patch

39 lines
1.0 KiB
Diff
Raw Normal View History

diff -up ATLAS/include/atlas_genparse.h.than ATLAS/include/atlas_genparse.h
--- ATLAS/include/atlas_genparse.h.than 2015-11-26 10:53:55.056586198 -0500
+++ ATLAS/include/atlas_genparse.h 2015-11-26 10:56:00.168537914 -0500
@@ -149,13 +149,24 @@ static int asmNames2bitfield(char *str)
}
/* procedure 7 */
-static int GetDoubleArr(char *str, int N, double *d)
+static int GetDoubleArr(char *callerstr, int N, double *d)
/*
* Reads in a list with form "%le,%le...,%le"; N-length d recieves doubles.
* RETURNS: the number of doubles found, or N, whichever is less
*/
{
- int i=1;
+ int i;
+ char *dupstr = DupString(callerstr);
+ char *str = dupstr;
+ /* strip the string to end on first white space */
+ for (i=0; dupstr[i]; i++)
+ {
+ if (isspace(dupstr[i])) {
+ dupstr[i] = '\0';
+ break;
+ }
+ }
+ i = 1;
assert(sscanf(str, "%le", d) == 1);
while (i < N)
{
@@ -167,6 +178,7 @@ static int GetDoubleArr(char *str, int N
break;
i++;
}
+ free(dupstr);
return(i);
}