[Aptitude-svn-commit] r4310 - in branches/aptitude-0.3/aptitude: . src/vscreen/config

Daniel Burrows dburrows at costa.debian.org
Tue Sep 27 16:52:25 UTC 2005


Author: dburrows
Date: Tue Sep 27 16:52:22 2005
New Revision: 4310

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/config/colors.cc
Log:
Don't crash if colors are unavailable.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Sep 27 16:52:22 2005
@@ -1,3 +1,10 @@
+2005-09-27  Daniel Burrows  <dburrows at debian.org>
+
+	* src/vscreen/config/colors.cc:
+
+	  Don't blow up if no colors are available (e.g., if the terminal
+	  doesn't support colors at all).
+
 2005-09-26  Daniel Burrows  <dburrows at debian.org>
 
 	* src/pkg_item.cc:

Modified: branches/aptitude-0.3/aptitude/src/vscreen/config/colors.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/config/colors.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/config/colors.cc	Tue Sep 27 16:52:22 2005
@@ -28,7 +28,7 @@
 
 void init_colors()
 {
-  if(COLOR_PAIRS<COLORS*COLORS)
+  if(COLORS == 0 || COLOR_PAIRS < COLORS * COLORS)
     return;
 
   colors_avail=true;



More information about the Aptitude-svn-commit mailing list