Skip to content

Commit

Permalink
tools/make-frozen.py: Handle trailing slash in argument more reliably.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfalcon committed Jun 3, 2015
1 parent 0e6c89a commit f8a39e3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tools/make-frozen.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ def module_name(f):

modules = []

root = sys.argv[1]
root = sys.argv[1].rstrip("/")
root_len = len(root)
if root[-1] != "/":
root_len += 1

for dirpath, dirnames, filenames in os.walk(root):
for f in filenames:
fullpath = dirpath + "/" + f
st = os.stat(fullpath)
modules.append((fullpath[root_len:], st))
modules.append((fullpath[root_len + 1:], st))

print("#include <stdint.h>")
print("const uint16_t mp_frozen_sizes[] = {")
Expand Down

0 comments on commit f8a39e3

Please sign in to comment.