[balsa] html.c: simpler regular expression



commit 572e3546e0ff606f6bc4ad434494f5305d39352f
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Feb 23 16:12:24 2019 -0500

    html.c: simpler regular expression
    
    * libbalsa/html.c: simpler regular expression for non-cid schemes.

 ChangeLog       | 4 ++++
 libbalsa/html.c | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index 21ee412fb..ca826ea08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-02-23  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       * libbalsa/html.c: simpler regular expression for non-cid schemes.
+
 2018-02-23  Albrecht Dreß  <albrecht dress arcor de>
 
        Error in IMAP mailbox encoding
diff --git a/libbalsa/html.c b/libbalsa/html.c
index f83c6155f..a3ead9254 100644
--- a/libbalsa/html.c
+++ b/libbalsa/html.c
@@ -44,7 +44,8 @@
 
 
 #define CID_REGEX      "<[^>]*src\\s*=\\s*['\"]?\\s*cid:"
-#define SRC_REGEX      "<[^>]*src\\s*=\\s*['\"]?\\s*[^c'\"][^i][^d][^:]"
+/* use a negative lookahead assertion to match "src=" *not* followed by "cid:" */
+#define SRC_REGEX      "<[^>]*src\\s*=\\s*(?!['\"]?\\s*cid:)"
 
 /* approximate image resolution for printing */
 #define HTML_PRINT_DPI                 200.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]