Skip to content

Commit aa404a4

Browse files
fix typos in strip-lib.py (#17)
Agent-Logs-Url: https://github.com/stackless-dev/stackman/sessions/e29ff9b5-da02-4031-9f32-d483cace59d0 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kristjanvalur <6009543+kristjanvalur@users.noreply.github.com>
1 parent 774c7dd commit aa404a4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/strip-lib.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# nulls the timestamp filed in a windows .lib archive,
2-
# making the lib reproducable.
1+
# nulls the timestamp field in a windows .lib archive,
2+
# making the lib reproducible.
33
# the time is the TimeDateStamp in the COFF file header, four bytes at offset 4
44
# See https://blog.conan.io/2019/09/02/Deterministic-builds-with-C-C++.html
55
# also: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#archive-library-file-format
66
#
7-
# There are some additional fixes added for reproducability, such as fixing the zero-padding of names in the coff
7+
# There are some additional fixes added for reproducibility, such as fixing the zero-padding of names in the coff
88
# section headers.
99

1010
import struct
@@ -82,7 +82,7 @@ def read_lib(fp):
8282
print("longnames", result["longnames"])
8383
h = None
8484

85-
# now read the headers, possibly we alread read one above.
85+
# now read the headers, possibly we already read one above.
8686
while True:
8787
if h is None:
8888
h = header_read(fp)
@@ -202,13 +202,13 @@ def first_lm_write(fp, lm):
202202

203203
def second_lm_read(fp):
204204
# number of members
205-
m = struct.unpack("<L", fp.read(4))[0] # unsigned long, big-endian
205+
m = struct.unpack("<L", fp.read(4))[0] # unsigned long, little-endian
206206
offsets = []
207207
for _ in range(m):
208208
offsets.append(struct.unpack("<L", fp.read(4))[0])
209209

210210
# number of symbols
211-
n = struct.unpack("<L", fp.read(4))[0] # unsigned long, big-endian
211+
n = struct.unpack("<L", fp.read(4))[0] # unsigned long, little-endian
212212
indices = []
213213
for _ in range(n):
214214
indices.append(struct.unpack("<H", fp.read(2))[0]) # unsigned short

0 commit comments

Comments
 (0)