diff options
author | hexcoder <hexcoder-@users.noreply.github.com> | 2020-05-11 10:12:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 10:12:32 +0200 |
commit | 50a63777ec4b3de137aaa6968b738b084dccf007 (patch) | |
tree | fcdf3b345b7b3aa1defa074fd60557495ce0eaaf | |
parent | 26fe7a9d669448ed8711c575aecd452ce0fcb00a (diff) | |
download | afl++-50a63777ec4b3de137aaa6968b738b084dccf007.tar.gz |
python formatter: enhance detection of `#define`, needed for multi line macros
@andreafioraldi : please have a look at it. Goal is to detect forms of ' # define' also.
-rwxr-xr-x | .custom-format.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/.custom-format.py b/.custom-format.py index 164815b1..6f1b0bfa 100755 --- a/.custom-format.py +++ b/.custom-format.py @@ -70,8 +70,8 @@ def custom_format(filename): out = "" for line in src.split("\n"): - if line.startswith("#"): - if line.startswith("#define"): + if line.lstrip().startswith("#"): + if line[line.find("#")+1:].lstrip().startswith("define"): in_define = True if "/*" in line and not line.strip().startswith("/*") and line.endswith("*/") and len(line) < (COLUMN_LIMIT-2): |