-/* xscreensaver, Copyright (c) 1999 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1999, 2000 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
continue;
XDrawString (state->dpy, p, state->gc1,
i * safe_width, font->ascent,
- string + i, 1);
+ (char *) (string + i), 1);
}
/* Draw the cursor. */
set_cursor (p_state *state, Bool on)
{
if (set_cursor_1 (state, on))
-;
{
if (state->cursor_timer)
XtRemoveTimeOut (state->cursor_timer);
scroll (p_state *state)
{
int x, y;
+
for (x = 0; x < state->grid_width; x++)
{
p_cell *from = 0, *to = 0;
}
to = from;
- if (to->state == FLARE || to->state == NORMAL)
+ if (to && (to->state == FLARE || to->state == NORMAL))
{
to->state = FADE;
to->changed = True;
static void
print_char (p_state *state, int c)
{
+ static char last_c = 0;
+
p_cell *cell = &state->cells[state->grid_width * state->cursor_y
+ state->cursor_x];
if (c == '\r' || c == '\n')
{
- state->cursor_x = 0;
- if (state->cursor_y == state->grid_height - 1)
- scroll (state);
+ if (c == '\n' && last_c == '\r')
+ ; /* CRLF -- do nothing */
else
- state->cursor_y++;
+ {
+ state->cursor_x = 0;
+ if (state->cursor_y == state->grid_height - 1)
+ scroll (state);
+ else
+ state->cursor_y++;
+ }
}
else if (c == '\014')
{
}
}
set_cursor (state, True);
+
+ last_c = c;
}
"*ticks: 20",
"*delay: 50000",
"*cursor: 333",
- "*program: " ZIPPY_PROGRAM,
+ "*program: " FORTUNE_PROGRAM,
"*relaunch: 5",
0
};