octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #42609] strread.m doesn't properly process del


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #42609] strread.m doesn't properly process delimiter literals
Date: Wed, 25 Jun 2014 21:20:27 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 Iceweasel/29.0.1

Follow-up Comment #2, bug #42609 (project octave):

Thanks for the patch.  It seems to work if the format is a double quoted
string, in which case Octave converts the backslash string escapes to single
characters when it parses the double quoted string.  But if the format is a
single quoted string, it fails for me:


octave:1> s = sprintf ('1 2 3\n4 5 6\n7 8 9\n');
octave:2> [a, b, c] = strread (s, '%d %d %d\n')
warning: strread: literal '\n' (fmt spec # 4) does not match data
strread: FORMAT does not match data
error: called from 'strread' in file
/home/jwe/src/octave-stable/scripts/io/strread.m near line 754, column 13
error: called from:
error:   /home/jwe/src/octave-stable/scripts/io/strread.m at line 764, column
9


My understanding is that this works in Matlab.  Is there any reason that we
shouldn't alway do

+verabtim+
if (strcmp (typeinfo (fmt), 'sq_string'))
  fmt = do_string_escapes (fmt);
endif


at the beginning of strread?

I made that change here:

  http://hg.savannah.gnu.org/hgweb/octave/rev/c32f378e08f3

Let me know if there is some reason to not make this change.

Thanks.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42609>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]