view lib/xregcomp.c @ 243:6d13d06ec0ac

Might as well make the dependencies slightly more paranoid. (The only reason to have dependencies at all is so "make install" doesn't trigger a rebuild. A rebuild is always a build all anyway.)
author Rob Landley <>
date Tue, 22 Jan 2008 19:20:06 -0600
parents ce6956dfc0cf
children 86e2bdb2ad66
line wrap: on
line source

/* vi: set ts=4:
 *  Call regcomp() and handle errors.
 * Copyright 2007 Rob Landley <>
 * This is a separate file so environments that haven't got regular expression
 * support can configure this out and avoid a build break.

#include "toys.h"
#include "xregcomp.h"

void xregcomp(regex_t *preg, char *rexec, int cflags)
	int rc = regcomp(preg, rexec, cflags);

	if (rc) {
		char msg[256];
		regerror(rc, preg, msg, 255);
		error_exit("xregcomp: %s", msg);