X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fstarwars.c;h=fb58e4c525d90596f820f2f7a285352bb3381fe7;hp=cfb40f8c1e2262bf7844eb0fef14e80c04b67885;hb=a1d41b2aa6e18bf9a49b914a99dda8232c5d7762;hpb=3c58fb6311db49c46f1670922933b27c6ea0c065 diff --git a/hacks/glx/starwars.c b/hacks/glx/starwars.c index cfb40f8c..fb58e4c5 100644 --- a/hacks/glx/starwars.c +++ b/hacks/glx/starwars.c @@ -357,12 +357,17 @@ get_more_lines (sws_configuration *sc) return; } - if (*s == '\n' || col > sc->columns) + if (*s == '\r' || *s == '\n' || col > sc->columns) { int L = s - sc->buf; - if (*s == '\n') - *s++ = 0; + if (*s == '\r' || *s == '\n') + { + if (*s == '\r' && s[1] == '\n') /* swallow CRLF too */ + *s++ = 0; + + *s++ = 0; + } else { /* We wrapped -- try to back up to the previous word boundary. */