Skip to content

Commit cbfe329

Browse files
committed
patch 7.4.1032
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.
1 parent 3c6f92e commit cbfe329

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

src/eval.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9151,10 +9151,19 @@ prepare_assert_error(gap)
91519151
char buf[NUMBUFLEN];
91529152

91539153
ga_init2(gap, 1, 100);
9154-
ga_concat(gap, sourcing_name);
9155-
sprintf(buf, " line %ld", (long)sourcing_lnum);
9156-
ga_concat(gap, (char_u *)buf);
9157-
ga_concat(gap, (char_u *)": ");
9154+
if (sourcing_name != NULL)
9155+
{
9156+
ga_concat(gap, sourcing_name);
9157+
if (sourcing_lnum > 0)
9158+
ga_concat(gap, (char_u *)" ");
9159+
}
9160+
if (sourcing_lnum > 0)
9161+
{
9162+
sprintf(buf, "line %ld", (long)sourcing_lnum);
9163+
ga_concat(gap, (char_u *)buf);
9164+
}
9165+
if (sourcing_name != NULL || sourcing_lnum > 0)
9166+
ga_concat(gap, (char_u *)": ");
91589167
}
91599168

91609169
/*
@@ -9243,7 +9252,7 @@ assert_bool(argvars, isTrue)
92439252
{
92449253
prepare_assert_error(&ga);
92459254
fill_assert_error(&ga, &argvars[1],
9246-
(char_u *)(isTrue ? "True " : "False "),
9255+
(char_u *)(isTrue ? "True" : "False"),
92479256
NULL, &argvars[0]);
92489257
assert_error(&ga);
92499258
ga_clear(&ga);

src/version.c

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

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
1032,
744746
/**/
745747
1031,
746748
/**/

0 commit comments

Comments
 (0)