Skip to content

Commit bd9bf26

Browse files
committed
patch 8.1.1085: compiler warning for possibly uninitialized variable
Problem: Compiler warning for possibly uninitialized variable. (Tony Mechelynck) Solution: Make conditions more logical.
1 parent aff7491 commit bd9bf26

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

src/arabic.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -363,18 +363,23 @@ arabic_shape(
363363
int backward_combine = !prev_laa && can_join(prev_c, c);
364364
int forward_combine = can_join(c, next_c);
365365

366-
if (backward_combine && forward_combine)
367-
curr_c = curr_a->medial;
368-
if (backward_combine && !forward_combine)
369-
curr_c = curr_a->final;
370-
if (!backward_combine && forward_combine)
371-
curr_c = curr_a->initial;
372-
if (!backward_combine && !forward_combine)
373-
curr_c = curr_a->isolated;
366+
if (backward_combine)
367+
{
368+
if (forward_combine)
369+
curr_c = curr_a->medial;
370+
else
371+
curr_c = curr_a->final;
372+
}
373+
else
374+
{
375+
if (forward_combine)
376+
curr_c = curr_a->initial;
377+
else
378+
curr_c = curr_a->isolated;
379+
}
374380
}
375381

376-
// Sanity check -- curr_c should, in the future, never be 0.
377-
// We should, in the future, insert a fatal error here.
382+
// Character missing from the table means using original character.
378383
if (curr_c == NUL)
379384
curr_c = c;
380385

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@ static char *(features[]) =
775775

776776
static int included_patches[] =
777777
{ /* Add new patch number below this line */
778+
/**/
779+
1085,
778780
/**/
779781
1084,
780782
/**/

0 commit comments

Comments
 (0)