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

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

[Octave-bug-tracker] [bug #57632] 5.1.90 crash on cygwin


From: marco atzeri
Subject: [Octave-bug-tracker] [bug #57632] 5.1.90 crash on cygwin
Date: Mon, 20 Jan 2020 13:45:33 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0

Follow-up Comment #4, bug #57632 (project octave):

both versions of the original test are failing (see attachments),
so it is not "\r"

%!test
%! f = tempname ();
%! fid = fopen (f, "w+");
%! fprintf (fid, "1\n2\n3\n4\n5\n6");
%! fseek (fid, 0, "bof");
%! c = textscan (fid, "%f %f", 2);
%! E = feof (fid);
%! fclose (fid);
%! unlink (f);
%! assert (c, {1, 2});
%! assert (! E);
%!test
%! f = tempname ();
%! fid = fopen (f, "w+");
%! fprintf (fid, "1\r\n2\r3\n4\r\n5\n6");
%! fseek (fid, 0, "bof");
%! c = textscan (fid, "%f %f", 4);
%! fclose (fid);
%! unlink (f);
%! assert (c, {[1;3], [2;4]});

Textscan alone has no issue:

octave:1> c = textscan ("1\n2\r3\n4\r\n5\n6", "%f %f", 4)
c =
{
  [1,1] =

     1
     3

  [1,2] =

     2
     4

}

octave:2> c = textscan ("1\n2\r3\n4\r\n5\n6", "%f %f", 2)
c =
{
  [1,1] =  1
  [1,2] =  2
}

octave:3> c = textscan ("1\r\n2\r3\n4\r\n5\n6", "%f %f", 2)
c =
{
  [1,1] =  1
  [1,2] =  2
}

octave:4> c = textscan ("1\r\n2\r3\n4\r\n5\n6", "%f %f", 4)
c =
{
  [1,1] =

     1
     3

  [1,2] =

     2
     4

}

}



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57632>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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