* compile_reg_expr * * Compile a regular expression. ****************************************************************************/
| 10 | * Compile a regular expression. |
| 11 | ****************************************************************************/ |
| 12 | void compile_reg_expr(int cflags, const char *expr, regex_t *reg) |
| 13 | { |
| 14 | static const size_t ERROR_BUF_SIZE = 256; |
| 15 | char error_msg[ERROR_BUF_SIZE]; |
| 16 | int result; |
| 17 | |
| 18 | if ((result = regcomp(reg, expr, cflags)) != 0) { |
| 19 | regerror(result, reg, error_msg, ERROR_BUF_SIZE); |
| 20 | fprintf(stderr, "%s: %s\n", prog_name, error_msg); |
| 21 | exit(1); |
| 22 | } |
| 23 | } |
no test coverage detected