Mercurial > forge
diff extra/NaN/src/str2array.cpp @ 12436:b8b7b9fe9eb2 octave-forge
str2array: revert last change because it breaks beckward compatibility
author | schloegl |
---|---|
date | Tue, 15 Apr 2014 15:42:23 +0000 |
parents | 30062c102c94 |
children | 13815b367946 |
line wrap: on
line diff
--- a/extra/NaN/src/str2array.cpp Mon Apr 14 19:23:32 2014 +0000 +++ b/extra/NaN/src/str2array.cpp Tue Apr 15 15:42:23 2014 +0000 @@ -34,7 +34,7 @@ // // Output: // $Id: STR2ARRAY.cpp 7142 2010-03-30 18:48:06Z schloegl $ -// Copyright (C) 2010,2011,2014 Alois Schloegl <alois.schloegl@gmail.com> +// Copyright (C) 2010,2011 Alois Schloegl <alois.schloegl@gmail.com> // This function is part of the NaN-toolbox // http://pub.ist.ac.at/~schloegl/matlab/NaN/ // @@ -249,27 +249,15 @@ /* identify separators */ u = (uint8_t*) mxCalloc(1,slen+1); - int flag_newline; for (k = 0; k < slen; ) { if (strchr(cdelim,s[k]) != NULL) { - if (flag_newline) { - // ignore field delimiters after newline - s[k]==' '; - k++; - } - else { - u[k] = 1; // column delimiter - while (s[++k]==' '); // ignore extra space characters - } + u[k] = 1; // column delimiter + while (s[++k]==' '); // ignore extra space characters } - else if (strchr(rdelim,s[k]) != NULL) { + else if (strchr(rdelim,s[k]) != NULL) u[k++] = 2; // row delimiter - flag_newline = 1; - } - else { + else k++; // ordinary character - flag_newline = 0; - } } /* count dimensions and set delimiter elements to 0 */