Check command name/path for truncation and provide user feedback during

config parse (and use conf_cmd_add to populate defaults); based on a
discussion with Tiago Cunha.  While this looks ugly, there are likely
some other changes here to come.
This commit is contained in:
okan
2014-01-29 18:34:22 +00:00
parent c28467cda5
commit 1f8f19b4d5
3 changed files with 30 additions and 15 deletions

View File

@@ -137,7 +137,12 @@ main : FONTNAME STRING {
conf->snapdist = $2;
}
| COMMAND STRING string {
conf_cmd_add(conf, $2, $3);
if (!conf_cmd_add(conf, $2, $3)) {
yyerror("command name/path too long");
free($2);
free($3);
YYERROR;
}
free($2);
free($3);
}