svn commit: r223342 - head/contrib/top

Xin LI delphij at FreeBSD.org
Mon Jun 20 16:48:00 UTC 2011


Author: delphij
Date: Mon Jun 20 16:48:00 2011
New Revision: 223342
URL: http://svn.freebsd.org/changeset/base/223342

Log:
  Revert r214857 pursudant to 9.0-RELEASE cycle.
  
  Requested by:	jh

Modified:
  head/contrib/top/display.c
  head/contrib/top/top.h

Modified: head/contrib/top/display.c
==============================================================================
--- head/contrib/top/display.c	Mon Jun 20 16:42:20 2011	(r223341)
+++ head/contrib/top/display.c	Mon Jun 20 16:48:00 2011	(r223342)
@@ -698,7 +698,7 @@ char *text;
 	int width;
 
 	s = NULL;
-	width = screen_width;
+	width = display_width;
 	header_length = strlen(text);
 	if (header_length >= width) {
 		s = malloc((width + 1) * sizeof(char));
@@ -706,14 +706,6 @@ char *text;
 			return (NULL);
 		strncpy(s, text, width);
 		s[width] = '\0';
-	} else {
-		s = malloc((width + 1) * sizeof(char));
-		if (s == NULL)
-			return (NULL);
-		strncpy(s, text, width);
-		while (screen_width > header_length)
-			s[header_length++] = ' ';
-		s[width] = '\0';
 	}
 	return (s);
 }
@@ -738,7 +730,7 @@ char *text;
     if (header_status == ON)
     {
 	putchar('\n');
-	standout(text, stdout);
+	fputs(text, stdout);
 	lastline++;
     }
     else if (header_status == ERASE)

Modified: head/contrib/top/top.h
==============================================================================
--- head/contrib/top/top.h	Mon Jun 20 16:42:20 2011	(r223341)
+++ head/contrib/top/top.h	Mon Jun 20 16:48:00 2011	(r223342)
@@ -14,7 +14,7 @@
 extern int Header_lines;	/* 7 */
 
 /* Maximum number of columns allowed for display */
-#define MAX_COLS	512
+#define MAX_COLS	128
 
 /* Log base 2 of 1024 is 10 (2^10 == 1024) */
 #define LOG1024		10


More information about the svn-src-all mailing list