aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-03 07:42:26 +0000
committerRichard M. Stallman1994-05-03 07:42:26 +0000
commita007eef636c713ed46e38967fc818d8bd4ea6f2f (patch)
treede61ffd3aab8815fc6f24c466582bff46e1bbf68 /src
parentccfd5a004a57edde76ab26fc5c29c92765f5b92d (diff)
downloademacs-a007eef636c713ed46e38967fc818d8bd4ea6f2f.tar.gz
emacs-a007eef636c713ed46e38967fc818d8bd4ea6f2f.zip
(display_text_line): Since HPOS is negative, avoid
writing before the beginning of the charstarts line.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 2c6ace5032c..eb3e78a031f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2051,7 +2051,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2051 p1start = p1; 2051 p1start = p1;
2052 charstart = desired_glyphs->charstarts[vpos] + hpos; 2052 charstart = desired_glyphs->charstarts[vpos] + hpos;
2053 /* In case we don't ever write anything into it... */ 2053 /* In case we don't ever write anything into it... */
2054 *charstart = -1; 2054 desired_glyphs->charstarts[vpos][XFASTINT (w->left)] = -1;
2055 end = ZV; 2055 end = ZV;
2056 leftmargin = desired_glyphs->glyphs[vpos] + XFASTINT (w->left); 2056 leftmargin = desired_glyphs->glyphs[vpos] + XFASTINT (w->left);
2057 endp = leftmargin + width; 2057 endp = leftmargin + width;
@@ -2280,12 +2280,12 @@ display_text_line (w, start, vpos, hpos, taboffset)
2280 And don't clobber anything to the left of that. */ 2280 And don't clobber anything to the left of that. */
2281 if (p1prev < leftmargin) 2281 if (p1prev < leftmargin)
2282 { 2282 {
2283 charstart[0] = pos; 2283 p2x = charstart + (leftmargin - p1start);
2284 p2x = charstart; 2284 *p2x = pos;
2285 } 2285 }
2286 2286
2287 /* This loop skips over the char p2x initially points to. */ 2287 /* This loop skips over the char p2x initially points to. */
2288 while (++p2x != p2) 2288 while (++p2x < p2)
2289 *p2x = -1; 2289 *p2x = -1;
2290 } 2290 }
2291 } 2291 }
@@ -2307,7 +2307,10 @@ display_text_line (w, start, vpos, hpos, taboffset)
2307 /* Add 1 in the endtest to compensate for the fact that ENDP was 2307 /* Add 1 in the endtest to compensate for the fact that ENDP was
2308 made from WIDTH, which is 1 less than the window's actual 2308 made from WIDTH, which is 1 less than the window's actual
2309 internal width. */ 2309 internal width. */
2310 for (i = p1 - p1start + 1; i < endp - p1start + 1; i++) 2310 i = p1 - p1start + 1;
2311 if (p1 < leftmargin)
2312 i += leftmargin - p1;
2313 for (; i < endp - p1start + 1; i++)
2311 charstart[i] = 0; 2314 charstart[i] = 0;
2312 2315
2313 /* Handle continuation in middle of a character */ 2316 /* Handle continuation in middle of a character */