[Forensics-changes] [yara] 370/407: Abbreviate code in re.c

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:28:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.3.0
in repository yara.

commit 76fa8a21b941df6c17ea185f7f55378e05abf731
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Tue Feb 3 10:31:33 2015 +0100

    Abbreviate code in re.c
---
 libyara/re.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/libyara/re.c b/libyara/re.c
index 9084e5c..c647610 100644
--- a/libyara/re.c
+++ b/libyara/re.c
@@ -1680,7 +1680,9 @@ int yr_re_exec(
           break;
 
         case RE_OPCODE_SPACE:
+        case RE_OPCODE_NON_SPACE:
           prolog;
+
           switch(*input)
           {
             case ' ':
@@ -1695,26 +1697,10 @@ int yr_re_exec(
             default:
               match = FALSE;
           }
-          action = match ? ACTION_NONE : ACTION_KILL;
-          fiber->ip += 1;
-          break;
 
-        case RE_OPCODE_NON_SPACE:
-          prolog;
-          switch(*input)
-          {
-            case ' ':
-            case '\t':
-            case '\r':
-            case '\n':
-            case '\v':
-            case '\f':
-              match = FALSE;
-              break;
+          if (*ip == RE_OPCODE_NON_SPACE)
+            match = !match;
 
-            default:
-              match = TRUE;
-          }
           action = match ? ACTION_NONE : ACTION_KILL;
           fiber->ip += 1;
           break;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list