From f68561fbe1f3fbb7760aee4db046553a1bfd16e1 Mon Sep 17 00:00:00 2001 From: HMM Date: Fri, 27 Sep 2019 15:17:53 -0400 Subject: [PATCH] Fix check_autopickup_exceptions to return null pointer if no exception is found --- src/pickup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pickup.c b/src/pickup.c index 647f1daa9..c0ef2b0cf 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -722,9 +722,9 @@ struct obj *obj; *ape = iflags.autopickup_exceptions; if (ape) { char *objdesc = makesingular(doname(obj)); - do if (regex_match(objdesc, ape->regex)) return ape; - while (ape = ape->next); + while (ape && !regex_match(objdesc, ape->regex)) ape = ape->next; } + return ape; } boolean