Author: das
Date: Sat Feb 28 06:27:23 2009
New Revision: 189139
URL: http://svn.freebsd.org/changeset/base/189139

Log:
  Make `less -R' not crash all the time.

Modified:
  head/contrib/less/line.c

Modified: head/contrib/less/line.c
==============================================================================
--- head/contrib/less/line.c    Sat Feb 28 06:06:57 2009        (r189138)
+++ head/contrib/less/line.c    Sat Feb 28 06:27:23 2009        (r189139)
@@ -601,9 +601,11 @@ store_char(ch, a, rep, pos)
        {
                if (!is_ansi_end(ch) && !is_ansi_middle(ch)) {
                        /* Remove whole unrecognized sequence.  */
-                       do {
+                       while (curr) {
                                --curr;
-                       } while (!IS_CSI_START(linebuf[curr]));
+                               if (IS_CSI_START(linebuf[curr]))
+                                       break;
+                       }
                        return 0;
                }
                a = AT_ANSI;    /* Will force re-AT_'ing around it.  */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to