- skip empty lines and archive members
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 21 May 2008 10:32:39 +0000 (10:32 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 21 May 2008 10:32:39 +0000 (10:32 -0000)
scripts/bloat-o-meter

index f6608afb85b088a309203eeaaa445bbad4e429f9..49f552717980f479b40d96a73d78fe59c9d17bda 100755 (executable)
@@ -21,6 +21,12 @@ for f in sys.argv[1], sys.argv[2]:
 def getsizes(file):
     sym = {}
     for l in os.popen("nm --size-sort " + file).readlines():
+        l = l.strip()
+       # Skip empty lines
+        if not len(l): continue
+       # Skip archive members
+        if len(l.split()) == 1 and l.endswith(':'):
+          continue
         size, type, name = l[:-1].split()
         if type in "tTdDbBrR":
             if "." in name: name = "static." + name.split(".")[0]