view lib/xregcomp.c @ 115:19b5567f0a1b

Add readlink, xreadlink(), and change xrealloc() to not fight the stupid compiler so much.
author Rob Landley <>
date Sun, 29 Apr 2007 19:55:21 -0400
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);