Fixed display info about ".." directory in Info panel.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2009-10-31 23:04:35 +03:00
parent 7ce24c2f57
commit b39b23a627

View File

@ -70,7 +70,7 @@ static void info_box (Dlg_head *h, struct WInfo *info)
static void
info_show_info (struct WInfo *info)
{
static int i18n_adjust=0;
static int i18n_adjust = 0;
static const char *file_label;
GString *buff;
struct stat st;
@ -96,10 +96,10 @@ info_show_info (struct WInfo *info)
/* Print only lines which fit */
if(!i18n_adjust) {
if (i18n_adjust == 0) {
/* This printf pattern string is used as a reference for size */
file_label=_("File: %s");
i18n_adjust = str_term_width1(file_label) + 2;
file_label = _("File: %s");
i18n_adjust = str_term_width1 (file_label) + 2;
}
buff = g_string_new ("");
@ -208,15 +208,15 @@ info_show_info (struct WInfo *info)
tty_printf (_("Location: %Xh:%Xh"), (int)st.st_dev, (int)st.st_ino);
case 3:
{
const char *fname;
widget_move (&info->widget, 3, 2);
/* .ado: fname is invalid if selected == 0 && info called from current panel */
if (current_panel->selected){
fname = current_panel->dir.list [current_panel->selected].fname;
str_printf (buff, file_label,
str_trunc (current_panel->dir.list [current_panel->selected].fname,
info->widget.cols - i18n_adjust));
str_trunc (fname, info->widget.cols - i18n_adjust));
tty_print_string (buff->str);
} else
tty_print_string (_("File: None"));
}
case 2:
case 1:
@ -301,4 +301,3 @@ info_new (void)
return info;
}