plugin.c: Tell the user if a plugin could not be found.
authorSebastian Harl <sh@tokkee.org>
Mon, 31 Mar 2008 08:46:42 +0000 (10:46 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Mon, 31 Mar 2008 09:09:24 +0000 (11:09 +0200)
Up to now this error was silently ignored, letting the user believe that
everything went fine.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/plugin.c

index 23ea901..acf7620 100644 (file)
@@ -297,7 +297,7 @@ int plugin_load (const char *type)
 {
        DIR  *dh;
        const char *dir;
-       char  filename[BUFSIZE];
+       char  filename[BUFSIZE] = "";
        char  typename[BUFSIZE];
        int   typename_len;
        int   ret;
@@ -364,6 +364,9 @@ int plugin_load (const char *type)
 
        closedir (dh);
 
+       if (filename[0] == '\0')
+               fprintf (stderr, "Could not find plugin %s.\n", type);
+
        return (ret);
 }