aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:30 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:30 +0200
commite2b58f0ab81b2aafeb8c29a69abad7829fa21ab3 (patch)
treec4e410dd878ceed9fc058d14bad8011b423212fe /scripts
parenteaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95 (diff)
downloaddebian_htop-e2b58f0ab81b2aafeb8c29a69abad7829fa21ab3.tar.gz
debian_htop-e2b58f0ab81b2aafeb8c29a69abad7829fa21ab3.tar.bz2
debian_htop-e2b58f0ab81b2aafeb8c29a69abad7829fa21ab3.zip
Imported Upstream version 1.0.1upstream/1.0.1
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/MakeHeader.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/MakeHeader.py b/scripts/MakeHeader.py
index a84ae74..55eeed4 100755
--- a/scripts/MakeHeader.py
+++ b/scripts/MakeHeader.py
@@ -30,6 +30,7 @@ out.write( "" )
out.write( "#ifndef HEADER_" + name )
out.write( "#define HEADER_" + name )
+is_blank = False
for line in file.readlines():
line = line[:-1]
if state == ANY:
@@ -37,6 +38,8 @@ for line in file.readlines():
state = COPY
elif line == selfheader:
pass
+ elif line.find("#include") == 0:
+ pass
elif line.find("htop - ") == 0 and line[-2:] == ".c":
out.write(line[:-2] + ".h")
elif line.find("static ") != -1:
@@ -58,14 +61,22 @@ for line in file.readlines():
state = SKIP
else:
out.write( line )
+ is_blank = False
+ elif line == "":
+ if not is_blank:
+ out.write( line )
+ is_blank = True
else:
out.write( line )
+ is_blank = False
elif state == COPY:
+ is_blank = False
if line == "}*/":
state = ANY
else:
out.write( line )
elif state == SKIP:
+ is_blank = False
if len(line) >= 1 and line[0] == "}":
if static == 1:
state = SKIPONE
@@ -73,6 +84,7 @@ for line in file.readlines():
state = ANY
static = 0
elif state == SKIPONE:
+ is_blank = False
state = ANY
out.write( "" )

© 2014-2024 Faster IT GmbH | imprint | privacy policy