http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.34.tar.gz
[xscreensaver] / hacks / glx / starwars.c
index cfb40f8c1e2262bf7844eb0fef14e80c04b67885..fb58e4c525d90596f820f2f7a285352bb3381fe7 100644 (file)
@@ -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. */