diff options
author | Judd Vinet <judd@archlinux.org> | 2006-02-03 00:39:53 +0100 |
---|---|---|
committer | Judd Vinet <judd@archlinux.org> | 2006-02-03 00:39:53 +0100 |
commit | ec1fc664c9e806b1850a637336ad7c56a8931962 (patch) | |
tree | 36edf5ffc492d188b2149d465faa7f39b9d32ec0 /src/util.c | |
parent | 1bcc87c3feb41dc8004c3d600e3a3501a4060b44 (diff) | |
download | pacman-ec1fc664c9e806b1850a637336ad7c56a8931962.tar.gz pacman-ec1fc664c9e806b1850a637336ad7c56a8931962.tar.xz |
Imported from pacman-2.9.8.tar.gz
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,7 +1,7 @@ /* * util.c * - * Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org> + * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org> * * 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)); |