]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
scripts: fix app-layer-protos.c setup 8308/head
authorShivani Bhardwaj <shivani@oisf.net>
Tue, 20 Dec 2022 14:10:27 +0000 (19:40 +0530)
committerVictor Julien <vjulien@oisf.net>
Tue, 20 Dec 2022 15:17:11 +0000 (16:17 +0100)
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.

scripts/setup-app-layer.py

index ef5fcbac439d0b24de14286ab509b01d136efd0d..3d1e7a720be5f6baa7de654a6ce614c4ef8339c5 100755 (executable)
@@ -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):