changeset 16160:061cf939f7ce v8.1.1085

patch 8.1.1085: compiler warning for possibly uninitialized variable commit https://github.com/vim/vim/commit/bd9bf266fccbf7b7f09e476e09b61f0133e914db Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 30 18:25:39 2019 +0100 patch 8.1.1085: compiler warning for possibly uninitialized variable Problem: Compiler warning for possibly uninitialized variable. (Tony Mechelynck) Solution: Make conditions more logical.
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Mar 2019 18:30:04 +0100
parents a246f204d996
children 75fa84e2461b
files src/arabic.c src/version.c
diffstat 2 files changed, 17 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/arabic.c
+++ b/src/arabic.c
@@ -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;
 
--- a/src/version.c
+++ b/src/version.c
@@ -776,6 +776,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1085,
+/**/
     1084,
 /**/
     1083,