# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1357143998 18000 # Node ID 878623ca15e175010398b17d111461380b977f1e # Parent 23a180fd186d8e7f80c248119ac6daee66aa950c textscan.m: fix treatment of whitespace argument (bug #37961) diff -r 23a180fd186d -r 878623ca15e1 scripts/io/textscan.m --- a/scripts/io/textscan.m Fri Dec 21 16:05:26 2012 -0500 +++ b/scripts/io/textscan.m Wed Jan 02 11:26:38 2013 -0500 @@ -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