aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-06-08 09:31:48 -0500
committerTed Gould <ted@canonical.com>2009-06-08 09:31:48 -0500
commit63dad6a7ff9cebb6d55d19d8d4233a171100a320 (patch)
treee5464b3b24981a5bde6dec238cfe5834ebd7437d /src
parent7926d56f4dc89d8f30b0f6759119b8dd1507d666 (diff)
downloadlibayatana-indicator-63dad6a7ff9cebb6d55d19d8d4233a171100a320.tar.gz
libayatana-indicator-63dad6a7ff9cebb6d55d19d8d4233a171100a320.tar.bz2
libayatana-indicator-63dad6a7ff9cebb6d55d19d8d4233a171100a320.zip
Patch from Mark Trompell to make suffix checking better.
Diffstat (limited to 'src')
-rw-r--r--src/applet-main.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/applet-main.c b/src/applet-main.c
index fca71a7..2aa03ee 100644
--- a/src/applet-main.c
+++ b/src/applet-main.c
@@ -62,16 +62,10 @@ load_module (const gchar * name, GtkWidget * menu)
g_debug("Looking at Module: %s", name);
g_return_val_if_fail(name != NULL, FALSE);
- guint suffix_len = strlen(G_MODULE_SUFFIX);
- guint name_len = strlen(name);
-
- g_return_val_if_fail(name_len > suffix_len, FALSE);
-
- int i;
- for (i = 0; i < suffix_len; i++) {
- if (name[(name_len - suffix_len) + i] != (G_MODULE_SUFFIX)[i])
- return FALSE;
+ if (!g_str_has_suffix(name, G_MODULE_SUFFIX)) {
+ return FALSE;
}
+
g_debug("Loading Module: %s", name);
gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL);