Mercurial > hg > octave-nkf
diff scripts/io/strread.m @ 16724:b7667fcb9fbc
Substitute ostrsplit() for strsplit().
The function ostrsplit() is Octave's original strsplit(), and strsplit()
has been modified to be compatible with Matlab's version. Bug #39010.
* scripts/deprecated/javafields.m: Change call to ostrsplit().
* scripts/deprecated/javamethods.m: ditto
* scripts/general/fieldnames.m: ditto
* scripts/general/int2str.m: ditto
* scripts/general/methods.m: ditto
* scripts/general/num2str.m: ditto
* scripts/help/gen_doc_cache.m: ditto
* scripts/help/help.m: ditto
* scripts/help/lookfor.m: ditto
* scripts/io/strread.m: ditto
* scripts/java/javaclasspath.m: ditto
* scripts/miscellaneous/compare_versions.m: ditto
* scripts/miscellaneous/computer.m: ditto
* scripts/miscellaneous/fact.m: ditto
* scripts/miscellaneous/tar.m: ditto
* scripts/miscellaneous/unpack.m: ditto
* scripts/miscellaneous/what.m: ditto
* scripts/miscellaneous/zip.m: ditto
* scripts/pkg/private/configure_make.m: ditto
* scripts/pkg/private/fix_depends.m: ditto
* scripts/pkg/private/generate_lookfor_cache.m: ditto
* scripts/pkg/private/list_forge_packages.m: ditto
* scripts/pkg/private/unload_packages.m: ditto
* scripts/pkg/private/write_index.m: ditto
* scripts/plot/private/__file_filter__.m: ditto
* scripts/plot/private/__fltk_file_filter__.m: ditto
* scripts/plot/private/__go_draw_axes__.m: ditto
* scripts/plot/private/__next_line_style__.m: ditto
* scripts/testfun/rundemos.m: ditto
* scripts/testfun/runtests.m: ditto
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Thu, 06 Jun 2013 10:06:12 +0800 |
parents | 4d8462fe15b9 |
children | e39f00a32dc7 |
line wrap: on
line diff
--- a/scripts/io/strread.m +++ b/scripts/io/strread.m @@ -626,13 +626,13 @@ strrep (words(icol, jptr), fmt_words{ii}, ... [char(255) char(254)]); wrds(2:2:2*numel (words(icol, jptr))-1) = char (255); - wrds = strsplit ([wrds{:}], char (255), false); + wrds = ostrsplit ([wrds{:}], char (255)); words(icol, jptr) = ... wrds(find (cellfun ("isempty", strfind (wrds, char (254))))); wrds(find (cellfun ("isempty", strfind (wrds, char (254))))) ... = char (255); - words(icol+1, jptr) = strsplit (strrep ([wrds{2:end}], ... - char (254), fmt_words{ii}), char (255), false); + words(icol+1, jptr) = ostrsplit (strrep ([wrds{2:end}], ... + char (254), fmt_words{ii}), char (255)); ## Former trailing literal may now be leading for next specifier --ii; fwptr = [fwptr(1:ii) (++fwptr(ii+1:end))]; @@ -704,7 +704,7 @@ case {"%0", "%1", "%2", "%3", "%4", "%5", "%6", "%7", "%8", "%9"} sw = regexp (fmt_words{m}, '\d', "once"); ew = regexp (fmt_words{m}, '[nfudsq]') - 1; - nfmt = strsplit (fmt_words{m}(2:ew), ".", false); + nfmt = ostrsplit (fmt_words{m}(2:ew), "."); swidth = str2double (nfmt{1}); switch fmt_words{m}(ew+1) case {"d", "u", "f", "n"} @@ -777,7 +777,7 @@ endif ## Split text string along delimiters - out = strsplit (text, sep, mult_dlms_s1, "delimitertype", "legacy"); + out = ostrsplit (text, sep, mult_dlms_s1); if (index (sep, eol_char)); out = strrep (out, char (255), ''); endif ## In case of trailing delimiter, strip stray last empty word if (!isempty (out) && any (sep == text(end)))