comparison src/lstream.c @ 840:1e4e42de23d5

[xemacs-hg @ 2002-05-14 13:03:54 by ben] To: xemacs-patches@xemacs.org callproc.c: Use Fget_buffer_create() with a string buffer, as documented. extents.c: indentation. lstream.c: fix a bug in selective-display handling; not the crash we're seeing. marker.c: delete superfluous error-checking -- it's already there in bytebpos_to_membpos() and vice-versa.
author ben
date Tue, 14 May 2002 13:04:00 +0000
parents 6728e641994e
children 804517e16990
comparison
equal deleted inserted replaced
839:182d9d1c71a5 840:1e4e42de23d5
1665 1665
1666 static Bytecount 1666 static Bytecount
1667 lisp_buffer_reader (Lstream *stream, Intbyte *data, Bytecount size) 1667 lisp_buffer_reader (Lstream *stream, Intbyte *data, Bytecount size)
1668 { 1668 {
1669 struct lisp_buffer_stream *str = LISP_BUFFER_STREAM_DATA (stream); 1669 struct lisp_buffer_stream *str = LISP_BUFFER_STREAM_DATA (stream);
1670 Intbyte *orig_data = data;
1671 Bytebpos start; 1670 Bytebpos start;
1672 Bytebpos end; 1671 Bytebpos end;
1673 struct buffer *buf = XBUFFER (str->buffer); 1672 struct buffer *buf = XBUFFER (str->buffer);
1674 Bytecount src_used; 1673 Bytecount src_used;
1675 1674
1692 1691
1693 if (EQ (buf->selective_display, Qt) && str->flags & LSTR_SELECTIVE) 1692 if (EQ (buf->selective_display, Qt) && str->flags & LSTR_SELECTIVE)
1694 { 1693 {
1695 /* What a kludge. What a kludge. What a kludge. */ 1694 /* What a kludge. What a kludge. What a kludge. */
1696 Intbyte *p; 1695 Intbyte *p;
1697 for (p = orig_data; p < data; p++) 1696 for (p = data; p < data + src_used; p++)
1698 if (*p == '\r') 1697 if (*p == '\r')
1699 *p = '\n'; 1698 *p = '\n';
1700 } 1699 }
1701 1700
1702 set_byte_marker_position (str->start, end); 1701 set_byte_marker_position (str->start, end);