Index: devices/grotty/grotty.man =================================================================== RCS file: /home/ncvs/src/contrib/groff/src/devices/grotty/grotty.man,v retrieving revision 1.7 diff -u -r1.7 grotty.man --- devices/grotty/grotty.man 14 Oct 2002 09:15:17 -0000 1.7 +++ devices/grotty/grotty.man 16 Oct 2002 15:47:11 -0000 @@ -87,7 +87,7 @@ .LP Use the .B \-c -switch to revert to the old behaviour, printing a bold character +option to revert to the old behaviour, printing a bold character .I c with the sequence .RI ` c @@ -99,7 +99,9 @@ .RB ` _ .SM BACKSPACE .IR c '. -At the same time, color output is disabled. +If +.B \-c +is specified more than once, color output is also disabled. The same effect can be achieved by setting either the .B GROFF_NO_SGR environment variable or using the `sgr' X command (see below). @@ -203,7 +205,7 @@ Use .BR grotty 's old output format (see above). -This also disables color output. +If specified more than once, this also disables color output. . .TP .B \-d Index: devices/grotty/tty.cc =================================================================== RCS file: /home/ncvs/src/contrib/groff/src/devices/grotty/tty.cc,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 tty.cc --- devices/grotty/tty.cc 14 Oct 2002 09:12:27 -0000 1.1.1.4 +++ devices/grotty/tty.cc 16 Oct 2002 15:47:11 -0000 @@ -44,6 +44,7 @@ static int italic_flag = 0; static int reverse_flag = 0; static int old_drawing_scheme = 0; +static int color_output = 1; enum { UNDERLINE_MODE = 0x01, @@ -391,8 +392,10 @@ for (; *p == ' ' || *p == '\n'; p++) ; int n; - if (*p != '\0' && sscanf(p, "%d", &n) == 1 && n == 0) + if (*p != '\0' && sscanf(p, "%d", &n) == 1 && n == 0) { old_drawing_scheme = 1; + color_output = 0; + } else old_drawing_scheme = 0; } @@ -602,7 +605,7 @@ } assert(hpos == p->hpos); if (p->mode & COLOR_CHANGE) { - if (!old_drawing_scheme) { + if (color_output) { if (p->fore_color_idx != curr_fore_idx) { put_color(p->fore_color_idx, 0); curr_fore_idx = p->fore_color_idx; @@ -631,7 +634,7 @@ putstring(SGR_NO_BOLD); is_bold = 0; } - if (!old_drawing_scheme) { + if (color_output) { if (p->fore_color_idx != curr_fore_idx) { put_color(p->fore_color_idx, 0); curr_fore_idx = p->fore_color_idx; @@ -644,10 +647,10 @@ put_char(p->code); hpos++; } - if (!old_drawing_scheme - && (is_bold || is_underline - || curr_fore_idx != DEFAULT_COLOR_IDX - || curr_back_idx != DEFAULT_COLOR_IDX)) + if ((!old_drawing_scheme && (is_bold || is_underline)) + || (color_output + && (curr_fore_idx != DEFAULT_COLOR_IDX + || curr_back_idx != DEFAULT_COLOR_IDX))) putstring(SGR_DEFAULT); putchar('\n'); } @@ -677,8 +680,10 @@ { program_name = argv[0]; static char stderr_buf[BUFSIZ]; - if (getenv("GROFF_NO_SGR")) + if (getenv("GROFF_NO_SGR")) { old_drawing_scheme = 1; + color_output = 0; + } setbuf(stderr, stderr_buf); int c; static const struct option long_options[] = { @@ -702,8 +707,14 @@ bold_flag = 0; break; case 'c': - // Use old scheme for emboldening and underline. - old_drawing_scheme = 1; + if (!old_drawing_scheme) { + // Use old scheme for emboldening and underline. + old_drawing_scheme = 1; + } + else { + // Disable color output. + color_output = 0; + } break; case 'u': // Do not underline. Index: roff/nroff/nroff.man =================================================================== RCS file: /home/ncvs/src/contrib/groff/src/roff/nroff/nroff.man,v retrieving revision 1.9 diff -u -r1.9 nroff.man --- roff/nroff/nroff.man 11 Oct 2002 08:54:44 -0000 1.9 +++ roff/nroff/nroff.man 16 Oct 2002 15:47:11 -0000 @@ -33,18 +33,12 @@ .ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]" .el .RB "[\ " "\\$1" "\ ]" .. -.OP \-h -.OP \-i +.OP \-CchipStUv .OP \-m name .OP \-n num .OP \-o list -.OP \-p .OP \-r cn -.OP \-S -.OP \-t .OP \-T name -.OP \-U -.OP \-v .RI "[\ " "file" "\ .\|.\|.\ ]" .br .ad \na @@ -95,8 +89,8 @@ The .BR \-C , .BR \-i , -.BR \-n , .BR \-m , +.BR \-n , .BR \-o , and .B \-r Index: roff/nroff/nroff.sh =================================================================== RCS file: /home/ncvs/src/contrib/groff/src/roff/nroff/nroff.sh,v retrieving revision 1.13 diff -u -r1.13 nroff.sh --- roff/nroff/nroff.sh 11 Oct 2002 08:54:44 -0000 1.13 +++ roff/nroff/nroff.sh 16 Oct 2002 15:47:11 -0000 @@ -68,7 +68,7 @@ echo "GNU nroff (groff) version @VERSION@" exit 0 ;; --help) - echo "usage: nroff [-cChipt] [-mNAME] [-nNUM] [-oLIST] [-rCN] [-Tname] [FILE...]" + echo "usage: nroff [-CchipStUv] [-mNAME] [-nNUM] [-oLIST] [-rCN] [-Tname] [FILE...]" exit 0 ;; --) shift