File getdoublearr.stripwhite.patch of Package libatlas3

References: http://sourceforge.net/p/math-atlas/mailman/message/32471499/

Index: ATLAS/include/atlas_genparse.h
===================================================================
--- ATLAS.orig/include/atlas_genparse.h
+++ ATLAS/include/atlas_genparse.h
@@ -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)
    {
@@ -166,6 +177,7 @@ static int GetDoubleArr(char *str, int N
       assert(sscanf(str, "%le", d+i) == 1);
       i++;
    }
+   free(dupstr);
    return(i);
 }
 
openSUSE Build Service is sponsored by