mirror of https://github.com/MidnightCommander/mc
src/help.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
d450911558
commit
f8c0adec73
20
src/help.c
20
src/help.c
|
@ -126,10 +126,13 @@ static const char *
|
||||||
search_string (const char *start, const char *text)
|
search_string (const char *start, const char *text)
|
||||||
{
|
{
|
||||||
const char *result = NULL;
|
const char *result = NULL;
|
||||||
char *local_text = g_strdup (text);
|
char *local_text;
|
||||||
char *d = local_text;
|
char *d;
|
||||||
const char *e = start;
|
const char *e = start;
|
||||||
|
|
||||||
|
local_text = g_strdup (text);
|
||||||
|
d = local_text;
|
||||||
|
|
||||||
/* fmt sometimes replaces a space with a newline in the help file */
|
/* fmt sometimes replaces a space with a newline in the help file */
|
||||||
/* Replace the newlines in the link name with spaces to correct the situation */
|
/* Replace the newlines in the link name with spaces to correct the situation */
|
||||||
while (*d != '\0')
|
while (*d != '\0')
|
||||||
|
@ -140,7 +143,7 @@ search_string (const char *start, const char *text)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do search */
|
/* Do search */
|
||||||
for (d = local_text; *e; e++)
|
for (d = local_text; *e != '\0'; e++)
|
||||||
{
|
{
|
||||||
if (*d == *e)
|
if (*d == *e)
|
||||||
d++;
|
d++;
|
||||||
|
@ -170,7 +173,7 @@ search_string_node (const char *start, const char *text)
|
||||||
const char *e = start;
|
const char *e = start;
|
||||||
|
|
||||||
if (start != NULL)
|
if (start != NULL)
|
||||||
for (; *e && *e != CHAR_NODE_END; e++)
|
for (; *e != '\0' && *e != CHAR_NODE_END; e++)
|
||||||
{
|
{
|
||||||
if (*d == *e)
|
if (*d == *e)
|
||||||
d++;
|
d++;
|
||||||
|
@ -301,7 +304,7 @@ help_follow_link (const char *start, const char *lc_selected_item)
|
||||||
if (lc_selected_item == NULL)
|
if (lc_selected_item == NULL)
|
||||||
return start;
|
return start;
|
||||||
|
|
||||||
for (p = lc_selected_item; *p && *p != CHAR_NODE_END && *p != CHAR_LINK_POINTER; p++)
|
for (p = lc_selected_item; *p != '\0' && *p != CHAR_NODE_END && *p != CHAR_LINK_POINTER; p++)
|
||||||
;
|
;
|
||||||
if (*p == CHAR_LINK_POINTER)
|
if (*p == CHAR_LINK_POINTER)
|
||||||
{
|
{
|
||||||
|
@ -309,7 +312,8 @@ help_follow_link (const char *start, const char *lc_selected_item)
|
||||||
char link_name[MAXLINKNAME];
|
char link_name[MAXLINKNAME];
|
||||||
|
|
||||||
link_name[0] = '[';
|
link_name[0] = '[';
|
||||||
for (i = 1; *p != CHAR_LINK_END && *p && *p != CHAR_NODE_END && i < MAXLINKNAME - 3;)
|
for (i = 1;
|
||||||
|
*p != CHAR_LINK_END && *p != '\0' && *p != CHAR_NODE_END && i < MAXLINKNAME - 3;)
|
||||||
link_name[i++] = *++p;
|
link_name[i++] = *++p;
|
||||||
link_name[i - 1] = ']';
|
link_name[i - 1] = ']';
|
||||||
link_name[i] = '\0';
|
link_name[i] = '\0';
|
||||||
|
@ -597,7 +601,7 @@ help_show (WDialog * h, const char *paint_start)
|
||||||
g_string_free (word, TRUE);
|
g_string_free (word, TRUE);
|
||||||
|
|
||||||
/* Position the cursor over a nice link */
|
/* Position the cursor over a nice link */
|
||||||
if (active_col)
|
if (active_col != 0)
|
||||||
widget_gotoyx (h, active_line, active_col);
|
widget_gotoyx (h, active_line, active_col);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1143,7 +1147,7 @@ help_interactive_display (const gchar * event_group_name, const gchar * event_na
|
||||||
selected_item = search_string_node (main_node, STRING_LINK_START) - 1;
|
selected_item = search_string_node (main_node, STRING_LINK_START) - 1;
|
||||||
currentpoint = main_node + 1; /* Skip the newline following the start of the node */
|
currentpoint = main_node + 1; /* Skip the newline following the start of the node */
|
||||||
|
|
||||||
for (history_ptr = HISTORY_SIZE; history_ptr;)
|
for (history_ptr = HISTORY_SIZE; history_ptr != 0 ;)
|
||||||
{
|
{
|
||||||
history_ptr--;
|
history_ptr--;
|
||||||
history[history_ptr].page = currentpoint;
|
history[history_ptr].page = currentpoint;
|
||||||
|
|
Loading…
Reference in New Issue