summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 93414ec)
raw | patch | inline | side by side (parent: 93414ec)
author | Max Kellermann <max@duempel.org> | |
Wed, 17 Sep 2008 10:25:41 +0000 (12:25 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 17 Sep 2008 10:25:41 +0000 (12:25 +0200) |
src/screen_help.c | patch | blob | history |
diff --git a/src/screen_help.c b/src/screen_help.c
index 05b735eccc2c6c33f4ba85865d8479da1c3accf4..58ca6e13dd4e6f64627b3e318fe493231fdee0e1 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
{
static char buf[512];
- *highlight = 0;
- if (idx < help_text_rows) {
- *highlight = help_text[idx].highlight > 0;
- if (help_text[idx].command == CMD_NONE) {
- if (help_text[idx].text)
- g_snprintf(buf, sizeof(buf), " %s", _(help_text[idx].text));
- else if (help_text[idx].highlight == 2) {
- int i;
+ if (idx >= help_text_rows)
+ return NULL;
- for (i = 3; i < COLS - 3 && i < (int)sizeof(buf); i++)
- buf[i] = '-';
- buf[i] = '\0';
- } else
- g_strlcpy(buf, " ", sizeof(buf));
- return buf;
- }
+ if (help_text[idx].highlight)
+ *highlight = 1;
+ if (help_text[idx].command == CMD_NONE) {
if (help_text[idx].text)
- g_snprintf(buf, sizeof(buf),
- "%20s : %s ",
- get_key_names(help_text[idx].command, TRUE),
- _(help_text[idx].text));
- else
- g_snprintf(buf, sizeof(buf),
- "%20s : %s ",
- get_key_names(help_text[idx].command, TRUE),
- get_key_description(help_text[idx].command));
+ g_snprintf(buf, sizeof(buf), " %s", _(help_text[idx].text));
+ else if (help_text[idx].highlight == 2) {
+ int i;
+
+ for (i = 3; i < COLS - 3 && i < (int)sizeof(buf); i++)
+ buf[i] = '-';
+ buf[i] = '\0';
+ } else
+ g_strlcpy(buf, " ", sizeof(buf));
return buf;
}
- return NULL;
+ if (help_text[idx].text)
+ g_snprintf(buf, sizeof(buf),
+ "%20s : %s ",
+ get_key_names(help_text[idx].command, TRUE),
+ _(help_text[idx].text));
+ else
+ g_snprintf(buf, sizeof(buf),
+ "%20s : %s ",
+ get_key_names(help_text[idx].command, TRUE),
+ get_key_description(help_text[idx].command));
+ return buf;
}
static void