AmendHub

Download (as of this amendment):

jcs

/

amend

/

amendments

/

188

committer: Add missing HLock, check teLength instead of nLines

Apparently an empty TE can still have nLines of 1

jcs made amendment 188 18 days ago
--- committer.c Fri Oct 2 08:23:27 2026 +++ committer.c Sun Oct 4 10:21:37 2026 @@ -419,7 +419,7 @@ committer_update_menu(struct committer *committer) DisableItem(amendment_menu, AMENDMENT_MENU_EDIT_ID); DisableItem(amendment_menu, AMENDMENT_MENU_EXPORT_ID); - if ((*(committer->log_te))->nLines > 0 && committer->allow_commit) + if ((*(committer->log_te))->teLength > 0 && committer->allow_commit) HiliteControl(committer->commit_button, 0); else HiliteControl(committer->commit_button, 255); @@ -528,6 +528,7 @@ committer_commit(struct committer *committer) diff = NewHandle(committer->diff_len); if (diff != NULL) { + HLock(diff); if (TVGetText(committer->diff_tv, *diff, 0, committer->diff_len) != committer->diff_len) { progress(NULL);