mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* screen.c (show_dir): A small fix to avoid a crash in show_dir() with
a panel of more than 200 columns.
This commit is contained in:
parent
611114d735
commit
358f13f13d
@ -1,3 +1,8 @@
|
|||||||
|
2004-11-04 Jindrich Novy <jnovy@redhat.com>
|
||||||
|
|
||||||
|
* screen.c (show_dir): A small fix to avoid a crash in show_dir() with
|
||||||
|
a panel of more than 200 columns.
|
||||||
|
|
||||||
2004-11-03 Andrew V. Samoilov <sav@bcs.zp.ua>
|
2004-11-03 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||||
|
|
||||||
* file.c (make_symlink): Use g_strlcpy() instead of strcpy().
|
* file.c (make_symlink): Use g_strlcpy() instead of strcpy().
|
||||||
|
@ -728,7 +728,7 @@ mini_info_separator (WPanel *panel)
|
|||||||
static void
|
static void
|
||||||
show_dir (WPanel *panel)
|
show_dir (WPanel *panel)
|
||||||
{
|
{
|
||||||
char tmp[200];
|
char *tmp;
|
||||||
|
|
||||||
set_colors (panel);
|
set_colors (panel);
|
||||||
draw_double_box (panel->widget.parent,
|
draw_double_box (panel->widget.parent,
|
||||||
@ -750,9 +750,13 @@ show_dir (WPanel *panel)
|
|||||||
|
|
||||||
widget_move (&panel->widget, 0, 3);
|
widget_move (&panel->widget, 0, 3);
|
||||||
|
|
||||||
|
tmp = g_malloc (panel->widget.cols + 1);
|
||||||
|
tmp[panel->widget.cols] = '\0';
|
||||||
|
|
||||||
trim (strip_home_and_password (panel->cwd), tmp,
|
trim (strip_home_and_password (panel->cwd), tmp,
|
||||||
max (panel->widget.cols - 7, 0));
|
min (max (panel->widget.cols - 7, 0), panel->widget.cols) );
|
||||||
addstr (tmp);
|
addstr (tmp);
|
||||||
|
g_free (tmp);
|
||||||
widget_move (&panel->widget, 0, 1);
|
widget_move (&panel->widget, 0, 1);
|
||||||
addstr ("<");
|
addstr ("<");
|
||||||
widget_move (&panel->widget, 0, panel->widget.cols - 2);
|
widget_move (&panel->widget, 0, panel->widget.cols - 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user