summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 256d960)
raw | patch | inline | side by side (parent: 256d960)
author | Max Kellermann <max@duempel.org> | |
Thu, 25 Dec 2008 12:23:29 +0000 (13:23 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 25 Dec 2008 12:23:29 +0000 (13:23 +0100) |
Removed the "Error: " prefix and the newline. Separated the format
string.
string.
src/conf.c | patch | blob | history |
diff --git a/src/conf.c b/src/conf.c
index 5b3ebb3f7558652753832ff828d5d84f06212c95..78d8d79f0a7193fbc3714455c6cf7320a25bba86 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
strcasecmp(str, "on") == 0 || strcasecmp(str, "1") == 0;
}
+static void
+print_error(const char *msg, const char *input)
+{
+ fprintf(stderr, "%s: %s ('%s')\n",
+ /* To translators: prefix for error messages */
+ _("Error"), msg, input);
+}
+
static int
parse_key_value(char *str, size_t len, char **end)
{
else if( isdigit(c) )
state = KEY_PARSER_DEC;
else {
- fprintf(stderr,
- _("Error: Unsupported key definition - %s\n"),
- str);
+ print_error(_("Unsupported key definition"),
+ str);
return -1;
}
break;
case KEY_PARSER_CHAR:
if( next!='\'' ) {
- fprintf(stderr,
- _("Error: Unsupported key definition - %s\n"),
- str);
+ print_error(_("Unsupported key definition"),
+ str);
return -1;
}
value = c;
break;
case KEY_PARSER_HEX:
if( !isdigit(next) ) {
- fprintf(stderr,_("Error: Digit expected after 0x - %s\n"), str);
+ print_error(_("Digit expected after 0x"), str);
return -1;
}
value = (int) strtol(str+(i+1), end, 16);
while (i < len && str[i] != '=' && !g_ascii_isspace(str[i]))
buf[j++] = str[i++];
if( (cmd=get_key_command_from_name(buf)) == CMD_NONE ) {
- fprintf(stderr, _("Error: Unknown key command %s\n"), buf);
+ print_error(_("Unknown key command"), buf);
return -1;
}
g_strlcpy(buf, str+i, MAX_LINE_LENGTH);
len = strlen(buf);
if (len == 0) {
- fprintf(stderr,_("Error: Incomplete key definition - %s\n"), str);
+ print_error(_("Incomplete key definition"), str);
return -1;
}
}
if (key < 0) {
- fprintf(stderr,_("Error: Bad key definition - %s\n"), str);
+ print_error(_("Bad key definition"), str);
return -1;
}
if (!strcmp(str,"elapsed") || !strcmp(str,"remaining"))
return str;
else {
- fprintf(stderr,_("Error: Bad time display type - %s\n"), str);
+ print_error(_("Bad time display type"), str);
return DEFAULT_TIMEDISPLAY_TYPE;
}
}
buf[j++] = str[i++];
color = colors_str2color(buf);
if (color < 0) {
- fprintf(stderr,_("Error: Bad color %s [%d]\n"), buf, color);
+ print_error(_("Bad color"), buf);
return -1;
}
name = g_strdup(buf);
g_strlcpy(buf, str+i, MAX_LINE_LENGTH);
len = strlen(buf);
if (len == 0) {
- fprintf(stderr, _("Error: Incomplete color definition - %s\n"),
- str);
+ print_error(_("Incomplete color definition"), str);
g_free(name);
return -1;
}
}
if (value < 0 || i != 3) {
- fprintf(stderr, _("Error: Bad color definition - %s\n"), str);
+ print_error(_("Bad color definition"), str);
g_free(name);
return -1;
}
while( tmp && tmp[i] ) {
char *name = g_ascii_strdown(tmp[i], -1);
if (screen_lookup_name(name) == NULL) {
- fprintf(stderr,
- _("Error: Unsupported screen \"%s\"\n"),
- name);
+ print_error(_("Unsupported screen"), name);
free(name);
} else {
screen = g_realloc(screen, (j+2)*sizeof(char *));
match_found = 0;
if (!match_found)
- fprintf(stderr,
- _("Unknown configuration parameter: %s\n"),
- name);
+ print_error(_("Unknown configuration parameter"),
+ name);
}
}
}