Mercurial > hg > octave-lojdl
changeset 15871:878623ca15e1 stable
textscan.m: fix treatment of whitespace argument (bug #37961)
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Wed, 02 Jan 2013 11:26:38 -0500 |
parents | 23a180fd186d |
children | 1733bd181cb6 065bc7944335 |
files | scripts/io/textscan.m |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/io/textscan.m +++ b/scripts/io/textscan.m @@ -106,12 +106,12 @@ ## Check if there's at least one string format specifier fmt = strrep (format, "%", " %"); fmt = regexp (fmt, '[^ ]+', 'match'); - fmt = strtrim (fmt(strmatch ("%", fmt))) + fmt = strtrim (fmt(strmatch ("%", fmt))); has_str_fmt = all (cellfun ("isempty", strfind (strtrim (fmt(strmatch ("%", fmt))), 's'))); ## If there is a format, AND whitespace value = empty, ## don't add a space (char(32)) to whitespace if (! (isempty (args{ipos+1}) && has_str_fmt)) - args{ipos+1} = unique ([" ", whitespace]); + args{ipos+1} = unique ([" ", args{ipos+1}]); endif endif