1 /*****************************************************************************\
3 *****************************************************************************
4 * Please also read the file DISCLAIMER which is included in this software
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License (as published by the
9 * Free Software Foundation) version 2, dated June 1991.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
14 * conditions of the GNU General Public License for more details.
15 \*****************************************************************************/
21 /****************************************************************************
24 * Compile a regular expression.
25 ****************************************************************************/
26 void compile_reg_expr(int cflags
, const char *expr
, regex_t
*reg
)
28 static const size_t ERROR_BUF_SIZE
= 256;
29 char error_msg
[ERROR_BUF_SIZE
];
32 if ((result
= regcomp(reg
, expr
, cflags
)) != 0) {
33 regerror(result
, reg
, error_msg
, ERROR_BUF_SIZE
);
34 fprintf(stderr
, "%s: %s\n", prog_name
, error_msg
);