I believe this fixes the segfault.

I can't tell you if the output is what you expect, though.

--- BufferIterator.cpp~ Mon May 10 10:47:10 1999
+++ BufferIterator.cpp  Tue May 11 11:58:34 1999
@@ -89,7 +89,7 @@
 ostream & operator<<(ostream & o, BufferIterator const & b) {
     o << "BufferIterator: ";
     for (BufferIterator::path_type::const_iterator i= b.path.begin();
-        i != b.path.end(); ++i) {
+        i < b.path.end(); ++i) {
        o << *i << " ";
     }
     return o;

=================== output from kernel-0.5 code ==============================
[kayvan@satyr ~/kernel-0.5]$ ./lyx
Dump of the buffer:
Buffer {
  Parbox {
  0:
  }
}
<-- insert
InsetBuffer::insert(Chunk { string: 'Foo'  }) at 
  position (BufferIterator: buffer parbox(0/0) )
--> insert
Dump of the buffer:
Buffer {
  Parbox {
  0:Paragraph {
    0:Chunk { string: 'Foo'  }
    1:
    }
  1:
  }
}
Dump of iterators:
1: BufferIterator: buffer parbox(0/1) 
<-- insert
InsetBuffer::insert(Chunk { string: 'Bar'  }) at 
  position (BufferIterator: buffer parbox(1/1) )
--> insert
Dump of the buffer:
Buffer {
  Parbox {
  0:Paragraph {
    0:Chunk { string: 'Foo'  }
    1:
    }
  1:Paragraph {
    0:Chunk { string: 'Bar'  }
    1:
    }
  2:
  }
}
Dump of iterators:
1: BufferIterator:  
<-- insert
InsetBuffer::insert((Inset: 0)) at 
  position (BufferIterator: buffer parbox(0/2) paragraph(0/1) chunk(1/3) )
<-- insert
InsetBuffer::insert((Inset: 0)) at 
  position (BufferIterator: buffer parbox(0/2) paragraph(0/1) chunk(0/1) )
<-- insert
InsetBuffer::insert((Inset: 0)) at 
  position (BufferIterator: buffer parbox(0/2) paragraph(0/1) )
<-- insert
InsetBuffer::insert((Inset: 0)) at 
  position (BufferIterator: buffer parbox(0/2) )
--> insert
--> insert
--> insert
<-- insert
InsetBuffer::insert(Chunk { string: 'oo'  }) at 
  position (BufferIterator: buffer parbox(0/2) paragraph(0/1) chunk(1/1) )
--> insert
--> insert
Dump of the buffer:
Buffer {
  Parbox {
  0:Paragraph {
    0:Chunk { string: 'Foo'  }
    1:
    }
  1:Paragraph {
    0:Chunk { string: 'Bar'  }
    1:
    }
  2:
  }
}
Dump of iterators:
1: BufferIterator:  
<-- insert
InsetBuffer::insert(Chunk { string: 'e'  }) at 
  position (BufferIterator: buffer parbox(0/2) paragraph(0/1) chunk(1/3) )
--> insert
Dump of the buffer:
Buffer {
  Parbox {
  0:Paragraph {
    0:Chunk { string: 'Feoo'  }
    1:
    }
  1:Paragraph {
    0:Chunk { string: 'Bar'  }
    1:
    }
  2:
  }
}
Dump of iterators:
1: BufferIterator:  
<-- erase
InsetBuffer::erase from 
  position (BufferIterator: buffer parbox(0/2) paragraph(0/1) chunk(1/4) ) to
  position (BufferIterator: buffer parbox(1/2) paragraph(0/1) chunk(2/3) )
<-- erase
InsetBuffer::erase from 
  position (BufferIterator: chunk(1/4) ) to
  position (BufferIterator: chunk(4/4) )
--> erase
<-- erase
InsetBuffer::erase from 
  position (BufferIterator: buffer parbox(0/2) paragraph(1/1) ) to
  position (BufferIterator: buffer parbox(1/2) paragraph(0/1) chunk(2/3) )
<-- erase
InsetBuffer::erase from 
  position (BufferIterator: buffer parbox(0/2) paragraph(1/1) ) to
  position (BufferIterator: buffer parbox(1/2) paragraph(0/1) )
<-- erase
InsetBuffer::erase from 
  position (BufferIterator: paragraph(1/1) ) to
  position (BufferIterator: paragraph(1/1) )
--> erase
<-- erase
InsetBuffer::erase from 
  position (BufferIterator: buffer parbox(1/2) ) to
  position (BufferIterator: buffer parbox(1/2) paragraph(0/1) )
<-- erase
InsetBuffer::erase from 
  position (BufferIterator: buffer parbox(1/2) ) to
  position (BufferIterator: buffer parbox(1/2) )
--> erase
<-- erase
InsetBuffer::erase from 
  position (BufferIterator: paragraph(0/1) ) to
  position (BufferIterator: paragraph(0/1) )
--> erase
--> erase
--> erase
<-- erase
InsetBuffer::erase from 
  position (BufferIterator: chunk(0/3) ) to
  position (BufferIterator: chunk(2/3) )
--> erase
--> erase
--> erase
Dump of the buffer:
Buffer {
  Parbox {
  0:Paragraph {
    0:Chunk { string: 'F'  }
    1:
    }
  1:Paragraph {
    0:Chunk { string: 'r'  }
    1:
    }
  2:
  }
}
Dump of iterators:
1: BufferIterator:  
=================== End output from kernel-0.5 code ========================

                        ---Kayvan

-- 
Kayvan Aghaiepour Sylvan   | Proud husband of       | Father to
Sylvan Associates, Inc.    | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://www.isp.net/~kayvan |                        | Robin Gregory (2/28/92)

Reply via email to