gtk_text_buffer_insert(buffer, &end, win->buffer->str, -1);
gtk_text_buffer_get_iter_at_offset(buffer, &start, start_offset);
- // Default style
- gtk_text_buffer_apply_tag(buffer, default_tag, &start, &end);
-
// Player's style overrides
gtk_text_buffer_apply_tag(buffer, style_tag, &start, &end);
// GLK Program's style overrides
gtk_text_buffer_apply_tag(buffer, glk_style_tag, &start, &end);
+ // Default style
+ gtk_text_buffer_apply_tag(buffer, default_tag, &start, &end);
+
// Link style overrides
if(win->window_stream->hyperlink_mode) {
GtkTextTag *link_style_tag = gtk_text_tag_table_lookup(tags, "hyperlink");
gint available_space = win->width - gtk_text_iter_get_line_offset(&insert);
GtkTextTagTable *tags = gtk_text_buffer_get_tag_table(buffer);
+
GtkTextTag *default_tag = gtk_text_tag_table_lookup(tags, "default");
GtkTextTag *style_tag = gtk_text_tag_table_lookup(tags, win->window_stream->style);
GtkTextTag *glk_style_tag = gtk_text_tag_table_lookup(tags, win->window_stream->glk_style);
* <mathphrase>@len - 1</mathphrase>
* </inlineequation>
* characters have been read or a newline has been read. It then puts a
- * terminal null (<code>'\0'</code>) aracter on
+ * terminal null (<code>'\0'</code>) character on
* the end. It returns the number of characters actually read, including the
* newline (if there is one) but not including the terminal null.
*
if(str->unicode) /* Binary file with 4-byte characters */
{
/* Do it character-by-character */
- int foo;
- for(foo = 0; foo < len - 1; foo++)
+ int copycount;
+ for(copycount = 0; copycount < len - 1; copycount++)
{
glsi32 ch = read_ucs4be_char_from_file(str->file_pointer);
if(ch == -1)
{
- buf[foo] = '\0';
- return foo - 1;
+ buf[copycount] = '\0';
+ return copycount;
}
str->read_count++;
if(is_unicode_newline(ch, str->file_pointer, FALSE))
{
- buf[foo] = '\n';
- buf[foo + 1] = '\0';
- return foo;
+ buf[copycount++] = '\n';
+ buf[copycount] = '\0';
+ return copycount;
}
- buf[foo] = (ch > 0xFF)? '?' : (char)ch;
+ buf[copycount] = (ch > 0xFF)? '?' : (char)ch;
}
buf[len] = '\0';
- return foo;
+ return copycount;
}
else /* Regular binary file */
{
if(str->unicode) /* Binary file with 4-byte characters */
{
/* Do it character-by-character */
- int foo;
- for(foo = 0; foo < len - 1; foo++)
+ int copycount;
+ for(copycount = 0; copycount < len - 1; copycount++)
{
glsi32 ch = read_ucs4be_char_from_file(str->file_pointer);
if(ch == -1)
{
- buf[foo] = 0;
- return foo - 1;
+ buf[copycount] = 0;
+ return copycount;
}
str->read_count++;
if(is_unicode_newline(ch, str->file_pointer, FALSE))
{
- buf[foo] = ch; /* Preserve newline types??? */
- buf[foo + 1] = 0;
- return foo;
+ buf[copycount++] = ch; /* Preserve newline types??? */
+ buf[copycount] = 0;
+ return copycount;
}
- buf[foo] = ch;
+ buf[copycount] = ch;
}
buf[len] = 0;
- return foo;
+ return copycount;
}
else /* Regular binary file */
{