From owner-svn-src-all@FreeBSD.ORG Fri Mar 20 14:31:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 620821065693; Fri, 20 Mar 2009 14:31:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F53A8FC18; Fri, 20 Mar 2009 14:31:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KEV9PV005047; Fri, 20 Mar 2009 14:31:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KEV9kQ005045; Fri, 20 Mar 2009 14:31:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200903201431.n2KEV9kQ005045@svn.freebsd.org> From: Ed Schouten Date: Fri, 20 Mar 2009 14:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190157 - head/sys/dev/syscons/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2009 14:31:10 -0000 Author: ed Date: Fri Mar 20 14:31:08 2009 New Revision: 190157 URL: http://svn.freebsd.org/changeset/base/190157 Log: Just use default behaviour on tabstops when using too many columns. It seems I didn't fix this issue before committing teken to the tree. My initial idea was to somehow add an error mechanism to instruct the video driver author to increase T_NUMCOL when using very big terminals. It turns out we have platforms where we have gigantic consoles on systems like the Apple PowerMac G5, which means we crash there right now. Just ignore tabstops placed beyond column 160. Just force tabs to be placed on each 8 columns. Reported by: nwhitehorn Modified: head/sys/dev/syscons/teken/teken.c head/sys/dev/syscons/teken/teken_subr.h Modified: head/sys/dev/syscons/teken/teken.c ============================================================================== --- head/sys/dev/syscons/teken/teken.c Fri Mar 20 14:02:53 2009 (r190156) +++ head/sys/dev/syscons/teken/teken.c Fri Mar 20 14:31:08 2009 (r190157) @@ -361,8 +361,6 @@ void teken_set_winsize(teken_t *t, const teken_pos_t *p) { - teken_assert(p->tp_col <= T_NUMCOL); - t->t_winsize = *p; /* XXX: bounds checking with cursor/etc! */ t->t_scrollreg.ts_begin = 0; Modified: head/sys/dev/syscons/teken/teken_subr.h ============================================================================== --- head/sys/dev/syscons/teken/teken_subr.h Fri Mar 20 14:02:53 2009 (r190156) +++ head/sys/dev/syscons/teken/teken_subr.h Fri Mar 20 14:31:08 2009 (r190157) @@ -37,7 +37,8 @@ teken_tab_isset(teken_t *t, unsigned int { unsigned int b, o; - teken_assert(col <= T_NUMCOL); + if (col >= T_NUMCOL) + return ((col & 0x7) == 0); b = col / (sizeof(unsigned int) * 8); o = col % (sizeof(unsigned int) * 8); @@ -50,7 +51,8 @@ teken_tab_clear(teken_t *t, unsigned int { unsigned int b, o; - teken_assert(col <= T_NUMCOL); + if (col >= T_NUMCOL) + return; b = col / (sizeof(unsigned int) * 8); o = col % (sizeof(unsigned int) * 8); @@ -63,7 +65,8 @@ teken_tab_set(teken_t *t, unsigned int c { unsigned int b, o; - teken_assert(col <= T_NUMCOL); + if (col >= T_NUMCOL) + return; b = col / (sizeof(unsigned int) * 8); o = col % (sizeof(unsigned int) * 8);