File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1123,9 +1123,11 @@ luaV_buffer_index(lua_State *L)
1123
1123
{
1124
1124
const char * s = lua_tostring (L , 2 );
1125
1125
if (strncmp (s , "name" , 4 ) == 0 )
1126
- lua_pushstring (L , (char * ) b -> b_sfname );
1126
+ lua_pushstring (L , (b -> b_sfname == NULL )
1127
+ ? "" : (char * ) b -> b_sfname );
1127
1128
else if (strncmp (s , "fname" , 5 ) == 0 )
1128
- lua_pushstring (L , (char * ) b -> b_ffname );
1129
+ lua_pushstring (L , (b -> b_ffname == NULL )
1130
+ ? "" : (char * ) b -> b_ffname );
1129
1131
else if (strncmp (s , "number" , 6 ) == 0 )
1130
1132
lua_pushinteger (L , b -> b_fnum );
1131
1133
/* methods */
Original file line number Diff line number Diff line change @@ -198,11 +198,8 @@ endfunc
198
198
" Test vim.buffer().name and vim.buffer().fname
199
199
func Test_buffer_name ()
200
200
new
201
- " FIXME: for an unnamed buffer, I would expect
202
- " vim.buffer().name to give an empty string, but
203
- " it returns 0. Is it a bug?
204
- " so this assert_equal is commented out.
205
- " call assert_equal('', luaeval('vim.buffer().name'))
201
+ call assert_equal (' ' , luaeval (' vim.buffer().name' ))
202
+ call assert_equal (' ' , luaeval (' vim.buffer().fname' ))
206
203
bwipe!
207
204
208
205
new Xfoo
Original file line number Diff line number Diff line change @@ -789,6 +789,8 @@ static char *(features[]) =
789
789
790
790
static int included_patches [] =
791
791
{ /* Add new patch number below this line */
792
+ /**/
793
+ 164 ,
792
794
/**/
793
795
163 ,
794
796
/**/
You can’t perform that action at this time.
0 commit comments