emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/relint be3979a 19/44: Check TRIM argument of `split-str


From: Mattias Engdegård
Subject: [elpa] externals/relint be3979a 19/44: Check TRIM argument of `split-string' as well
Date: Tue, 26 Mar 2019 12:57:27 -0400 (EDT)

branch: externals/relint
commit be3979af7f49b770e0548a9c249c5bcc08d5e97a
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    Check TRIM argument of `split-string' as well
---
 trawl.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/trawl.el b/trawl.el
index 35923b0..5dd3f46 100644
--- a/trawl.el
+++ b/trawl.el
@@ -499,11 +499,19 @@
     (`(,(or `split-string `split-string-and-unquote
             `string-trim-left `string-trim-right
             `directory-files-recursively)
-       ,_ ,re-arg . ,_)
+       ,_ ,re-arg . ,rest)
      (unless (and (symbolp re-arg)
                   (memq re-arg trawl--checked-variables))
        (trawl--check-re re-arg (format "call to %s" (car form))
-                        file pos (cons 2 path))))
+                        file pos (cons 2 path)))
+     ;; split-string has another regexp argument (trim, arg 4)
+     (when (and (eq (car form) 'split-string)
+                (cadr rest))
+       (let ((trim (cadr rest)))
+         (unless (and (symbolp trim)
+                      (memq trim trawl--checked-variables))
+           (trawl--check-re trim (format "call to %s" (car form))
+                            file pos (cons 4 path))))))
     (`(,(or `defvar `defconst `defcustom)
        ,name ,re-arg . ,rest)
      (when (symbolp name)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]