diff options
author | mbornet-hl <mbornet.pro@wanadoo.fr> | 2015-10-05 14:35:31 +0200 |
---|---|---|
committer | mbornet-hl <mbornet.pro@wanadoo.fr> | 2015-10-05 14:35:31 +0200 |
commit | cc8d8535513a32044ec4e804ee5fa31a2425963c (patch) | |
tree | 011a714acafc139977d0fa0fcde555d477d123e2 | |
parent | 67412d61adae95a1f4e580d14a3bd1284c27c773 (diff) | |
download | hl-cc8d8535513a32044ec4e804ee5fa31a2425963c.zip hl-cc8d8535513a32044ec4e804ee5fa31a2425963c.tar.gz hl-cc8d8535513a32044ec4e804ee5fa31a2425963c.tar.bz2 |
Fixed a regression with option -D
-rw-r--r-- | src/cr_main.c | 12 | ||||
-rwxr-xr-x | src/hl | bin | 36120 -> 36120 bytes |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/cr_main.c b/src/cr_main.c index 035bae1..15f9459 100644 --- a/src/cr_main.c +++ b/src/cr_main.c @@ -20,7 +20,7 @@ * * File : cr_main.c * - * @(#) [MB] cr_main.c Version 1.60 du 15/10/04 - + * @(#) [MB] cr_main.c Version 1.61 du 15/10/05 - * * Functions in this file : * ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -681,7 +681,7 @@ int main(int argc, char *argv[]) break; case 'V': - fprintf(stderr, "%s: version %s\n", G.prgname, "1.60"); + fprintf(stderr, "%s: version %s\n", G.prgname, "1.61"); exit(1); break; @@ -727,13 +727,13 @@ int main(int argc, char *argv[]) printf("[%2d] ", ++_i); cr_start_color(&_re->col); printf("%s", _re->regex[0]); - cr_end_color(NULL); + cr_end_color(&_re->col); printf("\n"); if (_re->regex[1]) { printf(" => "); cr_start_color(&_re->col); printf("%s", _re->regex[1]); - cr_end_color(NULL); + cr_end_color(&_re->col); printf("\n"); } } @@ -752,7 +752,7 @@ int main(int argc, char *argv[]) ******************************************************************************/ void cr_usage(bool disp_config) { - fprintf(stderr, "%s: version %s\n", G.prgname, "1.60"); + fprintf(stderr, "%s: version %s\n", G.prgname, "1.61"); fprintf(stderr, "Usage: %s [-h|-H|-V|-[[%%.]eiuvdDEL1234][-[rgybmcwRGYBMCWn] regexp ...][--config_name ...] ]\n", G.prgname); fprintf(stderr, " -h : help\n"); @@ -1197,7 +1197,7 @@ void cr_end_color(struct cr_color *col) if (col) _out = col->out; else _out = stdout; - if (col->col_num != CR_NO_COLOR) { + if (col && col->col_num != CR_NO_COLOR) { fprintf(_out, "\033[0m"); } } Binary files differ |