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-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d05f95d65f3359aceb48e7f0bd5814bde3534e26;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."); }