From d95f3b285b31b40bfd3938ea7e8ee0701a859b4b Mon Sep 17 00:00:00 2001 From: TomAwezome Date: Sun, 23 Oct 2022 18:35:41 -0400 Subject: [PATCH] Make new Diff Flag DF_KEEP_FLAGS, use in Diff. Diff will now check the passed df_flags for the DF_KEEP_FLAGS bit, and if found it will NOT and-equals the flags with DF_ABORT_ALL_FILES, which means that automated Diff utilities can be more easily written, without breaking the manual pop-up window Diff Merge workflow functionality. --- src/System/Utils/Diff.ZC | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/System/Utils/Diff.ZC b/src/System/Utils/Diff.ZC index bea23c83..789d5fbc 100755 --- a/src/System/Utils/Diff.ZC +++ b/src/System/Utils/Diff.ZC @@ -36,6 +36,7 @@ I64 DiffEntriesCompare(CDocEntry *doc_e1, CDocEntry *doc_e2) #define DF_ABORT_FILE 0x10 #define DF_ABORT_ALL_FILES 0x20 #define DF_NO_MORE_PROMPTS_THIS_FILE 0x40 +#define DF_KEEP_FLAGS 0x80 // tells Diff NOT to &= with abort-all flag at call start U0 DiffSel(CDoc *doc, I64 *_df_flags, I64 j1_lo, I64 j1_hi, I64 j2_lo, I64 j2_hi, I64 count1, I64 count2, CDocEntry **doc_unsorted1, CDocEntry **doc_unsorted2) @@ -277,13 +278,8 @@ public Bool Diff(U8 *dst_file, U8 *src_file, I64 *_df_flags=NULL) else df_flags = 0; -// df_flags &= DF_ABORT_ALL_FILES; // This line removes ALL df_flags values passed to this function, - // while also setting df_flags to DF_ABORT_ALL_FILES - // if it somehow got passed with a value of DF_ABORT_ALL_FILES. - // ... this seems counterproductive, and makes utilizing Diff with df_flags - // very difficult... Changing this to instead !! UN-SET !! DF_ABORT_ALL_FILES, - // which is what I can only guess was the intended behaviour here? ........ - df_flags &= ~(DF_ABORT_ALL_FILES); + if (!(df_flags & DF_KEEP_FLAGS)) + df_flags &= DF_ABORT_ALL_FILES; doc_e = doc1->head.next; while (doc_e != doc1)