pb.type = PROP_STRING;
pb.data.p_string.str =
- xnew_atomic_array(Bufbyte, len);
- strncpy((char *)pb.data.p_string.str,
- (char *)pos, len);
+ xnew_atomic_array(Bufbyte, len+1);
+ xstrncpy((char *)pb.data.p_string.str,
+ (char *)pos, len+1);
pb.data.p_string.len = len;
Dynarr_add(prop, pb);
ADD_NEXT_OCTAL_RUNE_CHAR;
(void)add_failed;
-
+
data->cursor_type = orig_cursor_type;
if (prop && prop != ADD_FAILED )
Dynarr_free(prop);
data->bi_start_col_enabled = 0;
if (!allow_cursor)
data->bi_bufpos = 0;
- add_bufbyte_string_runes(data, XSTRING_DATA(string),
- XSTRING_LENGTH(string), 0, 1);
+ {
+ prop_block_dynarr * tmp = NULL;
+ tmp = add_bufbyte_string_runes(data,
+ XSTRING_DATA(string),
+ XSTRING_LENGTH(string),
+ 0, 1);
+ if(tmp)
+ Dynarr_free(tmp);
+ }
data->findex = orig_findex;
data->bi_bufpos = orig_bufpos;
data->bi_start_col_enabled = orig_start_col_enabled;
glyph_block_dynarr* tmpglyphs = 0;
/* #### I think this is safe, but could be wrong. */
data.ch = BI_BUF_FETCH_CHAR (b, data.bi_bufpos);
-
+
*prop = add_glyph_runes (&data);
tmpglyphs = data.ef->glyphs;
-
- if (*prop)
+
+ if (*prop)
{
/* If we just clipped a glyph and we are
at the end of a line and there are more
glyphs to display then do appropriate
processing to not get a continuation
glyph. */
- if (*prop != ADD_FAILED
+ if (*prop != ADD_FAILED
&& Dynarr_atp (*prop, 0)->type == PROP_GLYPH
&& data.ch == '\n') {
/* If there are no more glyphs
then do the normal processing.
-
+
#### This doesn't actually work
if the same glyph is present
more than once in the block. To
carry the index around which
might be problematic since the
fragment is recalculated for
- each line. */
+ each line. */
if (EQ (Dynarr_end (tmpglyphs)->glyph,
Dynarr_atp (*prop, 0)->data.p_glyph.glyph)) {
Dynarr_free (*prop);
goto done;
}
}
-
+
/* If the current position is covered by an invisible
extent, do nothing (except maybe add some
ellipses). */
gb.extent = Qnil;
gb.glyph = Vhscroll_glyph;
add_glyph_rune_noret(&data, &gb, BEGIN_GLYPHS,
- 0, GLYPH_CACHEL(w,
- HSCROLL_GLYPH_INDEX));
+ 0, GLYPH_CACHEL(w,
+ HSCROLL_GLYPH_INDEX));
} else {
/* This duplicates code down below to add a newline to
the end of an otherwise empty line. */
int need_modeline;
/* The lines had better exist by this point. */
- if (!(dla = window_display_lines(w, type)))
+ if (!(dla = window_display_lines(w, type))) {
abort();
+ return;
+ }
Dynarr_reset(dla);
w->max_line_len = 0;
new_start =
generate_display_line(w, ddl, 0, ddl->bufpos + ddl->offset,
&prop, DESIRED_DISP);
+ (void)new_start; // Silence set-not-read warning.
+
ddl->offset = 0;
/* #### If there is propagated stuff the fail. We could
new_start =
generate_display_line(w, ddl, 0, ddl->bufpos + ddl->offset,
&prop, DESIRED_DISP);
+ (void)new_start; // Silence set-not-read warning.
+
ddl->offset = 0;
/* If there is propagated stuff then it is pretty much a
}
#endif /* HAVE_X_WINDOWS */
-#ifdef HAVE_GTK
- if (!strcmp(display_use, "gtk")) {
- Vwindow_system = Qgtk;
- Vinitial_window_system = Qgtk;
- return;
- }
-#endif
-
#ifdef HAVE_TTY
/* If no window system has been specified, try to use the terminal. */
if (!isatty(0)) {