+2013-11-09 Eli Zaretskii <eliz@gnu.org>
+
+ * search.c (find_newline): If buffer text is relocated during the
+ "dumb loop", adjust C pointers into buffer text to follow suit.
+ (Bug#15841)
+
2013-11-09 Ćukasz Stelmach <stlman@poczta.fm> (tiny change)
* gtkutil.c (xg_check_special_colors): Use rgb: instead of rgbi:
*bytepos = nl + 1 - base + start_byte;
return BYTE_TO_CHAR (nl + 1 - base + start_byte);
}
+ if (newline_cache)
+ {
+ /* The call to know_region_cache could have
+ allocated memory and caused relocation of buffer
+ text. If it did, adjust pointers into buffer
+ text. */
+ ptrdiff_t offset = BYTE_POS_ADDR (start_byte) - base;
+
+ if (offset != 0)
+ {
+ cursor += offset;
+ base += offset;
+ ceiling_addr += offset;
+ nl += offset;
+ }
+ }
cursor = nl + 1;
}
*bytepos = nl - base + start_byte;
return BYTE_TO_CHAR (nl - base + start_byte);
}
+ if (newline_cache)
+ {
+ ptrdiff_t offset = BYTE_POS_ADDR (start_byte - 1) - base;
+
+ if (offset != 0)
+ {
+ cursor += offset;
+ base += offset;
+ ceiling_addr += offset;
+ nl += offset;
+ }
+ }
cursor = nl - 1;
}