view lib/xregcomp.c @ 297:6e65eefc37e9 0.0.6

Announce 0.0.6 release. (A bit early, so the next FWL release can use it.)
author Rob Landley <rob@landley.net>
date Mon, 26 May 2008 16:07:16 -0500
parents ce6956dfc0cf
children 86e2bdb2ad66
line wrap: on
line source

/* vi: set ts=4:
 *  Call regcomp() and handle errors.
 *
 * Copyright 2007 Rob Landley <rob@landley.net>
 *
 * 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);
		msg[255]=0;
		error_exit("xregcomp: %s", msg);
	}
}