From bug-octave-request at bevo dot che dot wisc dot edu Fri Feb 22 09:41:46 2002 Subject: diary is buggy is some contexts From: "John W. Eaton" To: Kwasniak Miroslaw Cc: bug-octave at bevo dot che dot wisc dot edu, mirek@zind.ikem.pwr.wroc.pl Date: Fri, 22 Feb 2002 09:41:23 -0600 On 22-Feb-2002, Kwasniak Miroslaw wrote: | octave-2.1.35:1> 1,diary | ans = 1 | panic: Segmentation fault -- stopping myself... | attempting to save variables to `octave-core'... | save to `octave-core' complete | Segmentation fault (core dumped) Please try the following patch. Thanks, jwe 2002-02-22 John W. Eaton * pager.cc (octave_pager_buf::sync): Set pointer to beginning of buffer after calling flush_currnt_contents_to_diary. (octave_diary_buf::sync): Call eback only once. Index: pager.cc =================================================================== RCS file: /usr/local/cvsroot/octave/src/pager.cc,v retrieving revision 1.88 diff -u -r1.88 pager.cc --- pager.cc 6 Feb 2001 01:57:06 -0000 1.88 +++ pager.cc 22 Feb 2002 15:36:49 -0000 at @ -239,9 +239,9 @@ { do_sync (buf, len, bypass_pager); - seekoff (0, std::ios::beg); - flush_current_contents_to_diary (); + + seekoff (0, std::ios::beg); } } at @ -257,7 +257,7 @@ octave_diary.write (buf, len); - diary_skip = 0; + diary_skip = 0; } void at @ -271,10 +271,12 @@ { if (write_to_diary_file && external_diary_file) { - int len = pptr () - eback (); + char *buf = eback (); + + int len = pptr () - buf; if (len > 0) - external_diary_file.write (eback (), len); + external_diary_file.write (buf, len); } seekoff (0, std::ios::beg); ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------