File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1123,9 +1123,11 @@ luaV_buffer_index(lua_State *L)
11231123 {
11241124 const char * s = lua_tostring (L , 2 );
11251125 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 );
11271128 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 );
11291131 else if (strncmp (s , "number" , 6 ) == 0 )
11301132 lua_pushinteger (L , b -> b_fnum );
11311133 /* methods */
Original file line number Diff line number Diff line change @@ -198,11 +198,8 @@ endfunc
198198" Test vim.buffer().name and vim.buffer().fname
199199func Test_buffer_name ()
200200 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' ))
206203 bwipe!
207204
208205 new Xfoo
Original file line number Diff line number Diff line change @@ -789,6 +789,8 @@ static char *(features[]) =
789789
790790static int included_patches [] =
791791{ /* Add new patch number below this line */
792+ /**/
793+ 164 ,
792794/**/
793795 163 ,
794796/**/
You can’t perform that action at this time.
0 commit comments