Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Mar 2009 14:31:09 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190157 - head/sys/dev/syscons/teken
Message-ID:  <200903201431.n2KEV9kQ005045@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903201431.n2KEV9kQ005045>