summary refs log tree commit diff
path: root/parse.y
diff options
context:
space:
mode:
authorokan <okan>2014-01-29 18:34:22 +0000
committerokan <okan>2014-01-29 18:34:22 +0000
commit1f8f19b4d50f59624e84a3c932b639670e0d8b27 (patch)
treec907b036ffb1255b4e60f3eefe6b50821c08fdf7 /parse.y
parentc28467cda5323f2251ed16a407fd77b7ec9e5ba6 (diff)
downloadcwm-1f8f19b4d50f59624e84a3c932b639670e0d8b27.tar.gz
cwm-1f8f19b4d50f59624e84a3c932b639670e0d8b27.tar.xz
cwm-1f8f19b4d50f59624e84a3c932b639670e0d8b27.zip
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.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 672a896..fb8c01e 100644
--- a/parse.y
+++ b/parse.y
@@ -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);
 		}