From: ypicchi-arm <67330153+ypicchi-arm@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:32:53 +0000 (+0100) Subject: Make vectorscan accept \0 starting pattern (#312) X-Git-Tag: vectorscan/5.4.12^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4c49f2aa263a577d8beb57f7958fb889bfa53db;p=thirdparty%2Fvectorscan.git Make vectorscan accept \0 starting pattern (#312) Vectorscan used to reject such pattern because they were being compared to "" and found to be an empty string. We now check the pattern length instead. Signed-off-by: Yoan Picchi --- diff --git a/src/compiler/compiler.cpp b/src/compiler/compiler.cpp index aa8de4ba..ec9295c9 100644 --- a/src/compiler/compiler.cpp +++ b/src/compiler/compiler.cpp @@ -417,7 +417,7 @@ void addLitExpression(NG &ng, unsigned index, const char *expression, "HS_FLAG_SOM_LEFTMOST are supported in literal API."); } - if (!strcmp(expression, "")) { + if (expLength == 0) { throw CompileError("Pure literal API doesn't support empty string."); }