0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.1.1085: compiler warning for possibly uninitialized variable

Problem:    Compiler warning for possibly uninitialized variable. (Tony
            Mechelynck)
Solution:   Make conditions more logical.
This commit is contained in:
Bram Moolenaar 2019-03-30 18:25:39 +01:00
parent aff749145e
commit bd9bf266fc
2 changed files with 17 additions and 10 deletions

View File

@ -363,18 +363,23 @@ arabic_shape(
int backward_combine = !prev_laa && can_join(prev_c, c);
int forward_combine = can_join(c, next_c);
if (backward_combine && forward_combine)
curr_c = curr_a->medial;
if (backward_combine && !forward_combine)
curr_c = curr_a->final;
if (!backward_combine && forward_combine)
curr_c = curr_a->initial;
if (!backward_combine && !forward_combine)
curr_c = curr_a->isolated;
if (backward_combine)
{
if (forward_combine)
curr_c = curr_a->medial;
else
curr_c = curr_a->final;
}
else
{
if (forward_combine)
curr_c = curr_a->initial;
else
curr_c = curr_a->isolated;
}
}
// Sanity check -- curr_c should, in the future, never be 0.
// We should, in the future, insert a fatal error here.
// Character missing from the table means using original character.
if (curr_c == NUL)
curr_c = c;

View File

@ -775,6 +775,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1085,
/**/
1084,
/**/