Skip to content

Commit

Permalink
Add constant for max filename length. No binary change.
Browse files Browse the repository at this point in the history
  • Loading branch information
inexorabletash committed Mar 19, 2022
1 parent c761025 commit f92a72b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SELF_MODIFIED_BYTE = $12
kMaxPathLength = 64
kPathBufferSize = 65
kDirStackBufferSize = 170
kMaxFilenameLength = 15

;;; ============================================================

Expand Down
2 changes: 1 addition & 1 deletion desk.acc/find.files.s
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ ignore_char:
lda buf_left
clc
adc buf_right
cmp #15 ; max length is 15
cmp #kMaxFilenameLength
bcs ret

jsr HideIP ; Insert
Expand Down
6 changes: 3 additions & 3 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -3307,7 +3307,7 @@ not_file_char:

file_char:
ldx typedown_buf
cpx #15
cpx #kMaxFilenameLength
bne :+
rts ; Z=1 to consume
:
Expand Down Expand Up @@ -15142,7 +15142,7 @@ LAEC6: jsr PromptInputLoop
jsr InputFieldIPEnd
lda path_buf1
beq LAEC6
cmp #16 ; max filename length + 1
cmp #kMaxFilenameLength+1
bcc LAEE1
LAED6: lda #kErrNameTooLong
jsr ShowAlert
Expand Down Expand Up @@ -16226,7 +16226,7 @@ ip_pos: .word 0
lda path_buf1
clc
adc path_buf2
cmp #15
cmp #kMaxFilenameLength
bcs ret

jsr HidePromptIP ; Insert
Expand Down
4 changes: 2 additions & 2 deletions desktop/ovl_format_erase.s
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ l5: jsr Bell
l6: jsr main::InputFieldIPEnd
lda path_buf1
beq l5 ; name is empty
cmp #16
cmp #kMaxFilenameLength+1
bcs l5 ; name > 15 characters
jsr main::SetCursorPointerWithFlag

Expand Down Expand Up @@ -266,7 +266,7 @@ l4: jsr Bell
l5: jsr main::InputFieldIPEnd
lda path_buf1
beq l4 ; name is empty
cmp #$10
cmp #kMaxFilenameLength+1
bcs l4 ; name > 15 characters
jsr main::SetCursorPointerWithFlag

Expand Down

0 comments on commit f92a72b

Please sign in to comment.