svn commit: r190157 - head/sys/dev/syscons/teken

Ed Schouten ed at FreeBSD.org
Fri Mar 20 07:31:10 PDT 2009


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);


More information about the svn-src-head mailing list