From b6a728584721defb67ccb047d8c76f3ad5774378 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Tue, 2 Apr 2024 03:10:35 +0200 Subject: [PATCH] [Bug] Remove symbol-less `public` directives in the pre-commit hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Another issue related to `public` that causes TASM32 version 5.0 to crash. Better staying on that version from now on… Thanks to spaztron64 for reporting this one! --- hooks/pre-commit | 10 ++++++++-- th02_main.asm | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index 4baa6cf3..7e823659 100644 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -8,11 +8,17 @@ else against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 fi -# Remove trailing commas from `public` directives. These crash on TASM32 -# version 5.0, but work on later versions. +# Remove trailing commas from `public` directives, as well as `public` +# directives without arguments. These crash on TASM32 version 5.0, but work on +# later versions. for f in `git diff-index --name-only --cached --diff-filter=ACMRX ${against} | grep \.asm$ -i`; do if [ -n "$(sed -b -i -E 's/(public\s+[^;]+?),\s*(;.*)?$/\1\2/w /dev/stdout' "$f")" ]; then echo "$f"': removed a trailing comma from a `public` line, please re-stage.' exit 1 fi + if grep -q -E "^public$" "$f"; then + sed -b -i -E '/^public\r?$/d' "$f" + echo "$f"': removed a symbol-less `public`, please re-stage.' + exit 1 + fi done diff --git a/th02_main.asm b/th02_main.asm index d222be34..543e9382 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -29710,7 +29710,6 @@ _ITEM_PATNUM label byte include th02/main/power_overflow[data].asm _item_skill dw 0 -public public _ITEM_MISS_VELOCITY_Y_CENTER _ITEM_MISS_VELOCITY_Y_SIDES db 0B0h, 0BCh, 0C8h, 0D4h, 0E0h _ITEM_MISS_VELOCITY_X_CENTER db -2, -1, 0, 1, 2