CodeWrite icon indicating copy to clipboard operation
CodeWrite copied to clipboard

Drops first char when parsing address from .asm for Insertion Address when CRLF newline type

Open dreamsyntax opened this issue 1 year ago • 0 comments

Affected Version

CodeWrite 1.0.6

The Problem

When using the Open ASM File... feature from a previously valid saved 'Save ASM File` works as expected. However if committing these files in something like a git repo, with the standard newline configuration (LF being replaced with CRLF) results in bad behavior.

Example:

802D1BE8

With ASM
  li r18, 0x0

Opening this with LF line endings has the proper insertion address of 802D1BE8

Opening this with CRLF line endings results in: 02D1BE8

Alternatively you can clone this repo to experience the CRLF behavior: https://github.com/ShadowSpeedrun/ShadowSX/tree/main/ASM%20Changes

Notice the newline is included and the 8 is dropped

Proposed Solution

Parse CRLF as LF OR read the first 8 chars of the insertion address, truncating the rest

Interim Solution if there is never another update

On your repo make .gitattributes with this as content: *.asm text eol=lf

dreamsyntax avatar Mar 30 '24 04:03 dreamsyntax