[pacman-dev] Warn about skipping invalid regex with -Fx

Message ID 20191108123053.76646-1-allan@archlinux.org
State Superseded, archived
Headers show
Series [pacman-dev] Warn about skipping invalid regex with -Fx | expand

Commit Message

Allan McRae Nov. 8, 2019, 12:30 p.m. UTC
Print a warning when -Fx encounters a broken regex.

These were previosly skipped silently as when providing -Fx with multiple
arguments, a file that matches any of the arguments is returned. This
means encountering one broken argument is not an error.

Signed-off-by: Allan McRae <allan@archlinux.org>
---
 src/pacman/files.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/src/pacman/files.c b/src/pacman/files.c
index 3b6dc23b..fa3d9651 100644
--- a/src/pacman/files.c
+++ b/src/pacman/files.c
@@ -115,7 +115,7 @@  static int files_search(alpm_list_t *syncs, alpm_list_t *targets, int regex) {
 
 		if(regex) {
 			if(regcomp(&reg, targ, REG_EXTENDED | REG_NOSUB | REG_ICASE | REG_NEWLINE) != 0) {
-				/* TODO: error message */
+				pm_printf(ALPM_LOG_WARNING, "skipping invalid regex: '%s'\n", targ);
 				goto notfound;
 			}
 		}