patch 9.1.0766: too many strlen() calls in ex_getln.c

Problem:  too many strlen() calls in ex_getln.c
Solution: refactor the code to reduce the number of strlen() calls
          (John Marriott)

closes: #15809

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/search.c b/src/search.c
index 661bcc7..aeb519c 100644
--- a/src/search.c
+++ b/src/search.c
@@ -421,6 +421,12 @@
 {
     return spats[RE_SEARCH].pat;
 }
+
+    size_t
+last_search_pattern_len(void)
+{
+    return spats[RE_SEARCH].patlen;
+}
 #endif
 
 /*