fix dired bug on first entry

* add missing initialization, prevented display of first file in list
* fix same bug in bufed
This commit is contained in:
Charlie Gordon 2014-03-11 19:36:00 +00:00
commit 948a67dff4
2 changed files with 4 additions and 2 deletions

View file

@ -363,6 +363,7 @@ static int bufed_mode_init(EditState *s, ModeSavedData *saved_data)
return -1;
bs->signature = &bufed_signature;
bs->last_index = -1;
s->b->priv_data = bs;
s->b->close = bufed_close;
}

View file

@ -96,8 +96,8 @@ static char *dired_get_filename(EditState *s,
if (!(ds = dired_get_state(s, 1)))
return NULL;
/* CG: assuming buf_size > 0 */
buf[0] = '\0';
if (buf_size > 0)
buf[0] = '\0';
if (index < 0)
index = dired_get_index(s);
@ -576,6 +576,7 @@ static int dired_mode_init(EditState *s, ModeSavedData *saved_data)
ds->signature = &dired_signature;
ds->sort_mode = DIRED_SORT_GROUP | DIRED_SORT_NAME;
ds->last_index = -1;
s->b->priv_data = ds;
s->b->close = dired_close;