Support DOS line endings in delink.sh

DOS line endings in objects.csv, as one might encounter when cloning on
Windows, would break the delinking script by adding an extra \r onto
every line.  The extra carriage return character is now removed.
This commit is contained in:
KeybadeBlox 2026-05-13 20:17:32 -04:00
parent 20fecdd5fb
commit 9b9a736d4c

View file

@ -21,7 +21,9 @@ main() {
printf '=== Delinking object files into ../decompile/target/ ===\n'
while IFS= read -r line; do # Read objects.csv line by line
# Read objects.csv line by line (with EOL handling for Windows people)
CR=$(printf '\r')
while IFS=$CR read -r line; do
# Split columns (col 1 in $1, col 2 in $2, etc.)
set -f; IFS_PREV=$IFS; IFS=,
set -- $line