chiark / gitweb /
Quieten compiler
[disorder] / server / actions.c
index 8e975e447451731d91455ad9ed0b0711e474dab9..c0a8cb4b0a169d3c5aa112058a3009e5b1eca5fe 100644 (file)
@@ -161,8 +161,8 @@ static const struct action {
   { "enable", act_enable },
   { "manage", act_playing },
   { "playing", act_playing },
-  { "random-disable", act_random_disable },
-  { "random-enable", act_random_enable },
+  { "randomdisable", act_random_disable },
+  { "randomenable", act_random_enable },
   { "remove", act_remove },
 };
 
@@ -171,7 +171,9 @@ static const struct action {
  */
 void dcgi_expand(const char *name) {
   const char *p;
-  
+
+  /* Parse macros first */
+  mx_expand_file("macros.tmpl", sink_discard(), 0);
   /* For unknown actions check that they aren't evil */
   for(p = name; *p && isalnum((unsigned char)*p); ++p)
     ;
@@ -220,12 +222,8 @@ void dcgi_action(const char *action) {
 }
 
 /** @brief Generate an error page */
-void dcgi_error(const char *msg, ...) {
-  va_list ap;
-
-  va_start(ap, msg);
-  byte_xvasprintf(&dcgi_error_string, msg, ap);
-  va_end(ap);
+void dcgi_error(const char *key) {
+  dcgi_error_string = xstrdup(key);
   dcgi_expand("error");
 }