From ec1fc664c9e806b1850a637336ad7c56a8931962 Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Thu, 2 Feb 2006 23:39:53 +0000 Subject: Imported from pacman-2.9.8.tar.gz --- src/util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 528cc91f..ee703754 100644 --- a/src/util.c +++ b/src/util.c @@ -1,7 +1,7 @@ /* * util.c * - * Copyright (c) 2002-2005 by Judd Vinet + * Copyright (c) 2002-2006 by Judd Vinet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -433,7 +433,11 @@ int reg_match(char *string, char *pattern) int result; regex_t reg; - regcomp(®, pattern, REG_EXTENDED | REG_NOSUB); + if (regcomp(®, pattern, REG_EXTENDED | REG_NOSUB | REG_ICASE) != 0) + { + fprintf(stderr, "error: %s is not a valid regular expression.\n", pattern); + exit(1); + } result = regexec(®, string, 0, 0, 0); regfree(®); return(!(result)); -- cgit v1.2.3-24-g4f1b