Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
fix mem+log
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Raab committed Dec 11, 2016
1 parent a4ffbeb commit 2c9f941
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/libs/tools/src/plugindatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ std::vector<std::string> ModulesPluginDatabase::listAllPlugins () const
glob_t pglob;
if (glob (BUILTIN_PLUGIN_FOLDER "/libelektra-*", GLOB_NOSORT, NULL, &pglob) == 0)
{
ELEKTRA_LOG ("has glob %zd", pglob.gl_pathc);
for (size_t i = 0; i < pglob.gl_pathc; ++i)
{
std::string fn (pglob.gl_pathv[i]);
Expand All @@ -69,8 +70,8 @@ std::vector<std::string> ModulesPluginDatabase::listAllPlugins () const
if (toIgnore.find (name) != toIgnore.end ()) continue; // ignore
ret.push_back (name);
}
globfree (&pglob);
}
globfree (&pglob);
#endif
if (!ret.empty ())
{
Expand Down
8 changes: 5 additions & 3 deletions src/plugins/augeas/augeas.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ static const char * getLensPath (Plugin * handle)
int elektraAugeasGenConf (KeySet * ks, Key * errorKey ELEKTRA_UNUSED)
{
glob_t pglob;
int retval = 1;
const char * f = "/usr/share/augeas/lenses/dist/*.aug";
if (glob (f, GLOB_NOSORT, NULL, &pglob) == 0)
{
printf ("has glob %zd\n", pglob.gl_pathc);
ELEKTRA_LOG ("has glob %zd", pglob.gl_pathc);
for (size_t i = 0; i < pglob.gl_pathc; ++i)
{
char * p = elektraStrDup (basename (pglob.gl_pathv[i]));
Expand All @@ -99,16 +100,17 @@ int elektraAugeasGenConf (KeySet * ks, Key * errorKey ELEKTRA_UNUSED)
p[l - 4] = '.';
keySetString (k, p);
ksAppendKey (ks, k);
printf ("%s\n", p);
}
elektraFree (p);
}
globfree (&pglob);
}
else
{
ELEKTRA_SET_ERRORF (142, errorKey, "Could not glob %s", f);
retval = -1;
}
return 1;
return retval;
}

static const char * getAugeasError (augeas * augeasHandle)
Expand Down

0 comments on commit 2c9f941

Please sign in to comment.