From: Shivani Bhardwaj Date: Tue, 20 Dec 2022 14:10:27 +0000 (+0530) Subject: scripts: fix app-layer-protos.c setup X-Git-Tag: suricata-7.0.0-rc1~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21edf136a53c848068ffef42c71f7802aec65924;p=thirdparty%2Fsuricata.git scripts: fix app-layer-protos.c setup After the changes in the script in 05e16820de, the file app-layer-protos.c was to be modified properly iff it was left unformatted. However, the file was also formatted as a part of the same commit making the lines split which broke the output of the script. Fix that by looking for another pattern and changing the lines following that. --- diff --git a/scripts/setup-app-layer.py b/scripts/setup-app-layer.py index ef5fcbac43..3d1e7a720b 100755 --- a/scripts/setup-app-layer.py +++ b/scripts/setup-app-layer.py @@ -146,7 +146,7 @@ def patch_app_layer_protos_c(protoname): temp = temp.replace("template", protoname.lower()) output.write(temp) - if line.find("return ALPROTO_TEMPLATE;") > -1: + if line.find("strcmp(proto_name, \"template\")") > -1: # Duplicate the section starting at this line and # including the following line. for j in range(i, i + 2):