diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-09-11 08:22:05 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-09-11 08:22:05 +0000 |
commit | 1e1e5dafd7f35cff0f26db086fdbd4097e0a8cb1 (patch) | |
tree | a0f210fc6612d07492896a04dc33d99107347243 /src/xdisp.c | |
parent | 1f9581b61c03d5a763dcd8cca22363a7dca81bc9 (diff) | |
download | emacs-1e1e5dafd7f35cff0f26db086fdbd4097e0a8cb1.tar.gz |
(init_from_display_pos): Put some code in #if 0.
(add_to_log): Use bcopy instead of strcpy.
(init_from_display_pos): Use an explicit loop over bytes in
overlay strings instead of calling index.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 01543b8ecbd..85d58dbd7fe 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1840,11 +1840,19 @@ init_from_display_pos (it, w, pos) init_iterator (it, w, charpos, bytepos, NULL, DEFAULT_FACE_ID); for (i = 0; i < it->n_overlay_strings; ++i) - if (index (XSTRING (it->overlay_strings[i])->data, '\n')) - { - overlay_strings_with_newlines = 1; - break; - } + { + char *s = XSTRING (it->overlay_strings[i])->data; + char *e = s + STRING_BYTES (XSTRING (it->overlay_strings[i])); + + while (s < e && *s != '\n') + ++s; + + if (s < e) + { + overlay_strings_with_newlines = 1; + break; + } + } /* If position is within an overlay string, set up IT to the right overlay string. */ @@ -1881,6 +1889,11 @@ init_from_display_pos (it, w, pos) it->current.string_pos = pos->string_pos; it->method = next_element_from_string; } + +#if 0 /* This is bogus because POS not having an overlay string + position does not mean it's after the string. Example: A + line starting with a before-string and initialization of IT + to the previous row's end position. */ else if (it->current.overlay_string_index >= 0) { /* If POS says we're already after an overlay string ending at @@ -1894,6 +1907,7 @@ init_from_display_pos (it, w, pos) if (CHARPOS (pos->pos) == ZV) it->overlay_strings_at_end_processed_p = 1; } +#endif /* 0 */ if (CHARPOS (pos->string_pos) >= 0) { @@ -5558,7 +5572,7 @@ add_to_log (format, arg1, arg2) len = STRING_BYTES (XSTRING (msg)) + 1; buffer = (char *) alloca (len); - strcpy (buffer, XSTRING (msg)->data); + bcopy (XSTRING (msg)->data, buffer, len); message_dolog (buffer, len - 1, 1, 0); UNGCPRO; |