diff options
author | James McCoy <jamessan@jamessan.com> | 2021-10-11 21:04:37 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-11 21:04:37 +0100 |
commit | 37f341d7236ff8a1e886bbb0f0ba0700ad589373 (patch) | |
tree | 29c70b5c40983ddf885446b2c2a4d8905e9a5ce7 | |
parent | a9173d06f7ca320fc84f4ffa993861d21710bc41 (diff) | |
download | vim-git-37f341d7236ff8a1e886bbb0f0ba0700ad589373.tar.gz |
patch 8.2.3498: recover test may fail on some systemsv8.2.3498
Problem: Recover test may fail on some systems.
Solution: Adjust the little endian and 64 bit detection. (James McCoy,
closes #8941)
-rw-r--r-- | src/testdir/test_recover.vim | 8 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/testdir/test_recover.vim b/src/testdir/test_recover.vim index 9d2588313..d0129747b 100644 --- a/src/testdir/test_recover.vim +++ b/src/testdir/test_recover.vim @@ -208,9 +208,11 @@ func Test_recover_corrupted_swap_file() " Not all fields are written in a system-independent manner. Detect whether " the test is running on a little or big-endian system, so the correct " corruption values can be set. - let little_endian = b[1008:1011] == 0z33323130 - " The swap file header fields can be either 32-bit or 64-bit. - let system_64bit = b[1012:1015] == 0z00000000 + " The B0_MAGIC_LONG field may be 32-bit or 64-bit, depending on the system, + " even though the value stored is only 32-bits. Therefore, need to check + " both the high and low 32-bits to compute these values. + let little_endian = (b[1008:1011] == 0z33323130) || (b[1012:1015] == 0z33323130) + let system_64bit = little_endian ? (b[1012:1015] == 0z00000000) : (b[1008:1011] == 0z00000000) " clear the B0_MAGIC_LONG field if system_64bit diff --git a/src/version.c b/src/version.c index c360692f2..c916c5e89 100644 --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3498, +/**/ 3497, /**/ 3496, |