projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.00.tar.gz
[xscreensaver]
/
hacks
/
phosphor.c
diff --git
a/hacks/phosphor.c
b/hacks/phosphor.c
index 1188f2e60696504e35889b621005504dcebb0558..8298cf2551ee67f265563eee839493923b346fbc 100644
(file)
--- a/
hacks/phosphor.c
+++ b/
hacks/phosphor.c
@@
-567,6
+567,8
@@
scroll (p_state *state)
static void
print_char (p_state *state, int c)
{
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];
p_cell *cell = &state->cells[state->grid_width * state->cursor_y
+ state->cursor_x];
@@
-581,11
+583,16
@@
print_char (p_state *state, int c)
if (c == '\r' || c == '\n')
{
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
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')
{
}
else if (c == '\014')
{
@@
-611,6
+618,8
@@
print_char (p_state *state, int c)
}
}
set_cursor (state, True);
}
}
set_cursor (state, True);
+
+ last_c = c;
}
}
@@
-770,7
+779,7
@@
char *defaults [] = {
"*ticks: 20",
"*delay: 50000",
"*cursor: 333",
"*ticks: 20",
"*delay: 50000",
"*cursor: 333",
- "*program: "
ZIPPY
_PROGRAM,
+ "*program: "
FORTUNE
_PROGRAM,
"*relaunch: 5",
0
};
"*relaunch: 5",
0
};