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 <[email protected]>
---
 src/pacman/files.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
                        }
                }
-- 
2.23.0

Reply via email to