aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/plugin_loader.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2008-05-20 15:03:15 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2008-05-20 15:03:15 +0000
commit7f02156ebff04618b4d1ac39ce6009851902bb8f (patch)
tree04d5ad3ee78570faacf9b9ccd2da433c3b4170bc /src/libstrongswan/plugins/plugin_loader.c
parent367cc86f4a1a6819badebddef95077941c9a7e39 (diff)
downloadstrongswan-7f02156ebff04618b4d1ac39ce6009851902bb8f.tar.bz2
strongswan-7f02156ebff04618b4d1ac39ce6009851902bb8f.tar.xz
fixed whitespace eating in plugin loader
Diffstat (limited to 'src/libstrongswan/plugins/plugin_loader.c')
-rw-r--r--src/libstrongswan/plugins/plugin_loader.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c
index 44081d15f..8d3d5e9c1 100644
--- a/src/libstrongswan/plugins/plugin_loader.c
+++ b/src/libstrongswan/plugins/plugin_loader.c
@@ -97,30 +97,36 @@ static int load(private_plugin_loader_t *this, char *path, char *list)
list = strdupa(list);
while (TRUE)
{
+ /* eat any whitespace in front */
+ while (*list == ' ')
+ {
+ list++;
+ }
+ /* have we reached the end of the list? */
+ if (!*list)
+ {
+ break;
+ }
pos = strchr(list, ' ');
if (pos)
{
*pos++ = '\0';
- while (*pos == ' ')
- {
- pos++;
- }
- if (!*pos)
- {
- break;
- }
}
+ DBG1("loaded plugin: '%s'", list);
plugin = load_plugin(this, path, list);
if (plugin)
{ /* insert in front to destroy them in reverse order */
this->plugins->insert_last(this->plugins, plugin);
count++;
}
- if (!pos)
+ if (pos)
+ {
+ list = pos;
+ }
+ else
{
break;
}
- list = pos;
}
return count;
}