Группа :: Система/Основа
Пакет: util-linux
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: 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);
}
/*