]> git.ipfire.org Git - thirdparty/tor.git/commit
Remove a bunch of other redundant #includes
authorNick Mathewson <nickm@torproject.org>
Tue, 20 Feb 2018 15:14:15 +0000 (10:14 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 20 Feb 2018 15:14:15 +0000 (10:14 -0500)
commit4438ef3288256e1f1ba706c157206a2ac190781d
tree3515fdc2c6f7b258c9fa81bb191e6bff90ecb66d
parenta4ab273a0dafdd85e8e9f204c6e3e092282d3620
Remove a bunch of other redundant #includes

Folks have found two in the past week or so; we may as well fix the
others.

Found with:

\#!/usr/bin/python3
import re

def findMulti(fname):
    includes = set()
    with open(fname) as f:
        for line in f:
            m = re.match(r'^\s*#\s*include\s+["<](\S+)[>"]', line)
            if m:
                inc = m.group(1)
                if inc in includes:
                    print("{}: {}".format(fname, inc))
                includes.add(m.group(1))

import sys
for fname in sys.argv[1:]:
    findMulti(fname)
17 files changed:
src/common/buffers.h
src/common/compat.c
src/common/compat_winthreads.c
src/or/circuituse.c
src/or/hs_client.c
src/or/hs_common.c
src/or/hs_intropoint.c
src/or/hs_service.c
src/or/rephist.c
src/or/status.c
src/test/test_address.c
src/test/test_config.c
src/test/test_dir_handle_get.c
src/test/test_helpers.c
src/test/test_hs_intropoint.c
src/test/testing_common.c
src/tools/tor-gencert.c