mirror of https://github.com/libsdl-org/SDL
xxd.py: always write \n line endings
Previously, `open()` was used with the default option of `newline=None`, which means that “any '\n' characters written are translated to the system default line separator”. Now, `xxd.py` always writes `\n` line endings. This eliminates the need for the .gitattributes file.
This commit is contained in:
parent
723bcd0a8b
commit
796713b9d5
|
@ -1,12 +0,0 @@
|
|||
*.c text
|
||||
*.cpp text
|
||||
*.h text
|
||||
*.cmake text
|
||||
*.py text
|
||||
*.txt text
|
||||
*.sh text
|
||||
*.vcxproj text eol=crlf
|
||||
*.sln text eol=crlf
|
||||
*.filters text eol=crlf
|
||||
*.appxmanifest text eol=crlf
|
||||
*.pbxproj text
|
|
@ -17,7 +17,7 @@ def main():
|
|||
|
||||
binary_data = args.input.open("rb").read()
|
||||
|
||||
with args.output.open("w") as fout:
|
||||
with args.output.open("w", newline="\n") as fout:
|
||||
fout.write("unsigned char {}[] = {{\n".format(varname))
|
||||
bytes_written = 0
|
||||
while bytes_written < len(binary_data):
|
||||
|
|
Loading…
Reference in New Issue