Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37864446
en ru br
Репозитории ALT
S:2.39.2-alt1
5.1: 2.16.1-alt1
4.1: 2.13-alt8
4.0: 2.12r-alt6
3.0: 2.12q-alt1
www.altlinux.org/Changes

Группа :: Система/Основа
Пакет: util-linux

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: util-linux-2.12-alt-pg.patch
Скачать


diff -Naur util-linux-2.12/text-utils/pg.c util-linux-2.12.new/text-utils/pg.c
--- util-linux-2.12/text-utils/pg.c	2002-11-25 03:43:32 +0300
+++ util-linux-2.12.new/text-utils/pg.c	2004-03-03 16:08:31 +0300
@@ -312,6 +312,49 @@
 	return write(1, &c, 1);
 }
 
+/* works like vidattr((~7)&attr) */
+void my_vidputs(chtype attr, int (*putc)(int));
+
+void my_vidputs(chtype attr, int (*putc)(int))
+{
+	    if (set_attributes)
+	            tputs(tparm(set_attributes,
+	                            (attr & A_STANDOUT) != 0,
+	                            (attr & A_UNDERLINE) != 0,
+	                            (attr & A_REVERSE) != 0,
+	                            (attr & A_BLINK) != 0,
+	                            (attr & A_DIM) != 0,
+	                            (attr & A_BOLD) != 0,
+	                            (attr & A_INVIS) != 0,
+	                            (attr & A_PROTECT) != 0,
+	                            (attr & A_ALTCHARSET) != 0), 1, putc);
+	    else
+	    { /* try to use enter_*_mode capabilities */
+	      /* turn all atributes first, it's similar to normal */
+		 if (exit_attribute_mode) tputs(tparm(exit_attribute_mode), 1, putc);
+
+		 if (enter_standout_mode && (attr&A_STANDOUT))
+		    tputs(tparm(enter_standout_mode), 1, putc);
+		 if (enter_underline_mode && (attr&A_UNDERLINE))
+		    tputs(tparm(enter_underline_mode), 1, putc);
+		 if (enter_reverse_mode && (attr&A_REVERSE))
+		    tputs(tparm(enter_reverse_mode), 1, putc);
+		 if (enter_blink_mode && (attr&A_BLINK))
+		    tputs(tparm(enter_blink_mode), 1, putc);
+		 if (enter_dim_mode && (attr&A_DIM))
+		    tputs(tparm(enter_dim_mode), 1, putc);
+		 if (enter_bold_mode && (attr&A_BOLD))
+		    tputs(tparm(enter_bold_mode), 1, putc);
+		 if (enter_secure_mode && (attr&A_INVIS))
+		    tputs(tparm(enter_secure_mode), 1, putc);
+		 if (enter_protected_mode && (attr&A_PROTECT))
+		    tputs(tparm(enter_protected_mode), 1, putc);
+		 if (enter_alt_charset_mode && (attr&A_ALTCHARSET))
+		    tputs(tparm(enter_alt_charset_mode), 1, putc);
+	    }
+}
+
+
 /*
  * Write messages to terminal.
  */
@@ -321,10 +364,10 @@
 	if (ontty == 0)
 		return;
 	if (*message != '\n' && sflag)
-		vidputs(A_STANDOUT, outcap);
+		my_vidputs(A_STANDOUT, outcap);
 	write(1, message, strlen(message));
 	if (*message != '\n' && sflag)
-		vidputs(A_NORMAL, outcap);
+		my_vidputs(A_NORMAL, outcap);
 }
 
 /*
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin