]> granicus.if.org Git - vim/commitdiff
patch 7.4.1032 v7.4.1032
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Jan 2016 19:59:10 +0000 (20:59 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Jan 2016 19:59:10 +0000 (20:59 +0100)
Problem:    message from assert_false() does not look nice.
Solution:   Handle missing sourcing_name. Use right number of spaces. (Watiko)
            Don't use line number if it's zero.

src/eval.c
src/version.c

index c613f4adbd6ea960264c98c801bdefe6443decf0..743c7436c6f3dba79ec35f94e9b47240f0ad4ea4 100644 (file)
@@ -9151,10 +9151,19 @@ prepare_assert_error(gap)
     char buf[NUMBUFLEN];
 
     ga_init2(gap, 1, 100);
-    ga_concat(gap, sourcing_name);
-    sprintf(buf, " line %ld", (long)sourcing_lnum);
-    ga_concat(gap, (char_u *)buf);
-    ga_concat(gap, (char_u *)": ");
+    if (sourcing_name != NULL)
+    {
+       ga_concat(gap, sourcing_name);
+       if (sourcing_lnum > 0)
+           ga_concat(gap, (char_u *)" ");
+    }
+    if (sourcing_lnum > 0)
+    {
+       sprintf(buf, "line %ld", (long)sourcing_lnum);
+       ga_concat(gap, (char_u *)buf);
+    }
+    if (sourcing_name != NULL || sourcing_lnum > 0)
+       ga_concat(gap, (char_u *)": ");
 }
 
 /*
@@ -9243,7 +9252,7 @@ assert_bool(argvars, isTrue)
     {
        prepare_assert_error(&ga);
        fill_assert_error(&ga, &argvars[1],
-               (char_u *)(isTrue ? "True " : "False "),
+               (char_u *)(isTrue ? "True" : "False"),
                NULL, &argvars[0]);
        assert_error(&ga);
        ga_clear(&ga);
index 6b225b336c2add15224f40a59c3dcde5b0a55d9a..72aa418d54e827688388656dedee53ed474db6dc 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1032,
 /**/
     1031,
 /**/