Date: Sat, 28 Feb 2009 06:27:23 +0000 (UTC) From: David Schultz <das@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r189139 - head/contrib/less Message-ID: <200902280627.n1S6RNIj097687@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902280627.n1S6RNIj097687>