Skip to content

Commit f8a39e3

Browse files
committed
tools/make-frozen.py: Handle trailing slash in argument more reliably.
1 parent 0e6c89a commit f8a39e3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

tools/make-frozen.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@ def module_name(f):
2626

2727
modules = []
2828

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

3432
for dirpath, dirnames, filenames in os.walk(root):
3533
for f in filenames:
3634
fullpath = dirpath + "/" + f
3735
st = os.stat(fullpath)
38-
modules.append((fullpath[root_len:], st))
36+
modules.append((fullpath[root_len + 1:], st))
3937

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

0 commit comments

Comments
 (0)