Skip to content

Commit bee6c0c

Browse files
committed
patch 7.4.1648
Problem: Compiler has a problem copying a string into di_key[]. (Yegappan Lakshmanan) Solution: Add dictitem16_T.
1 parent 8b20179 commit bee6c0c

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/eval.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,12 @@ typedef struct
292292
#define VV_RO 2 /* read-only */
293293
#define VV_RO_SBX 4 /* read-only in the sandbox */
294294

295-
#define VV_NAME(s, t) s, {{t, 0, {0}}, 0, {0}}, {0}
295+
#define VV_NAME(s, t) s, {{t, 0, {0}}, 0, {0}}
296296

297297
static struct vimvar
298298
{
299299
char *vv_name; /* name of variable, without v: */
300-
dictitem_T vv_di; /* value and name for key */
301-
char vv_filler[16]; /* space for LONGEST name below!!! */
300+
dictitem16_T vv_di; /* value and name for key (max 16 chars!) */
302301
char vv_flags; /* VV_COMPAT, VV_RO, VV_RO_SBX */
303302
} vimvars[VV_LEN] =
304303
{

src/structs.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,15 @@ struct dictitem_S
12211221
};
12221222
typedef struct dictitem_S dictitem_T;
12231223

1224+
/* A dictitem with a 16 character key (plus NUL). */
1225+
struct dictitem16_S
1226+
{
1227+
typval_T di_tv; /* type and value of the variable */
1228+
char_u di_flags; /* flags (only used for variable) */
1229+
char_u di_key[17]; /* key */
1230+
};
1231+
typedef struct dictitem16_S dictitem16_T;
1232+
12241233
#define DI_FLAGS_RO 1 /* "di_flags" value: read-only variable */
12251234
#define DI_FLAGS_RO_SBX 2 /* "di_flags" value: read-only in the sandbox */
12261235
#define DI_FLAGS_FIX 4 /* "di_flags" value: fixed: no :unlet or remove() */

src/version.c

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

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1648,
751753
/**/
752754
1647,
753755
/**/

0 commit comments

Comments
 (0)