Merge pull request #48 from matthiasclasen/bad-module-name

prevent confusing errors
tingping/wmclass
Alexander Larsson 2016-05-27 08:45:00 +02:00
commit 980cfe7400
2 changed files with 5 additions and 1 deletions

View File

@ -199,12 +199,16 @@ builder_module_set_property (GObject *object,
{
BuilderModule *self = BUILDER_MODULE (object);
gchar **tmp;
char *p;
switch (prop_id)
{
case PROP_NAME:
g_clear_pointer (&self->name, g_free);
self->name = g_value_dup_string (value);
if ((p = strchr (self->name, ' ')) ||
(p = strchr (self->name, '/')))
g_printerr ("Module names like '%s' containing '%c' are problematic. Expect errors.\n", self->name, *p);
break;
case PROP_SUBDIR:

View File

@ -282,7 +282,7 @@
<variablelist>
<varlistentry>
<term><option>name</option> (string)</term>
<listitem><para>The name of the module, used in e.g. build logs</para></listitem>
<listitem><para>The name of the module, used in e.g. build logs. The name is also used for constructing filenames and commandline arguments, therefore using spaces or '/' in this string is a bad idea.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>disabled</option> (boolean)</term>