mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-05 11:04:42 +03:00
src/filemanager/panel.c: clarify condition in 'for' statements.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
443b845b0f
commit
40caba34a9
@ -791,11 +791,8 @@ format_file (char *dest, int limit, WPanel * panel, int file_index, int width, i
|
|||||||
else
|
else
|
||||||
color = NORMAL_COLOR;
|
color = NORMAL_COLOR;
|
||||||
|
|
||||||
for (format = home; format; format = format->next)
|
for (format = home; format != NULL && length != width; format = format->next)
|
||||||
{
|
{
|
||||||
if (length == width)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (format->string_fn)
|
if (format->string_fn)
|
||||||
{
|
{
|
||||||
const char *txt = " ";
|
const char *txt = " ";
|
||||||
@ -2792,7 +2789,7 @@ panel_get_format_field_index_by_name (WPanel * panel, const char *name)
|
|||||||
gsize lc_index;
|
gsize lc_index;
|
||||||
|
|
||||||
for (lc_index = 1, format = panel->format;
|
for (lc_index = 1, format = panel->format;
|
||||||
!(format == NULL || strcmp (format->title, name) == 0); format = format->next, lc_index++)
|
format != NULL && strcmp (format->title, name) != 0; format = format->next, lc_index++)
|
||||||
;
|
;
|
||||||
|
|
||||||
if (format == NULL)
|
if (format == NULL)
|
||||||
@ -2808,8 +2805,7 @@ panel_get_format_field_by_index (WPanel * panel, gsize lc_index)
|
|||||||
{
|
{
|
||||||
format_e *format;
|
format_e *format;
|
||||||
|
|
||||||
for (format = panel->format;
|
for (format = panel->format; format != NULL && lc_index != 0; format = format->next, lc_index--)
|
||||||
!(format == NULL || lc_index == 0); format = format->next, lc_index--)
|
|
||||||
;
|
;
|
||||||
|
|
||||||
return format;
|
return format;
|
||||||
|
Loading…
Reference in New Issue
Block a user