[gimp] app: Do not use strsep() in action-search-dialog.c
- From: Michael Henning <mhenning src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: Do not use strsep() in action-search-dialog.c
- Date: Wed, 19 Feb 2014 16:04:31 +0000 (UTC)
commit ecf8a158110447daaedc80e3dc62b1b0856c827d
Author: Michael Henning <drawoc darkrefraction com>
Date: Wed Feb 19 10:58:09 2014 -0500
app: Do not use strsep() in action-search-dialog.c
It's not available on windows.
app/dialogs/action-search-dialog.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/app/dialogs/action-search-dialog.c b/app/dialogs/action-search-dialog.c
index 55702e3..f79ac25 100644
--- a/app/dialogs/action-search-dialog.c
+++ b/app/dialogs/action-search-dialog.c
@@ -809,9 +809,8 @@ action_search_match_keyword (GtkAction *action,
if (! matched && strchr (key, ' '))
{
- gchar *key_copy = g_strdup (key);
- gchar *words = key_copy;
- gchar *word;
+ gchar **words;
+ gchar **word;
matched = TRUE;
if (section)
@@ -819,17 +818,18 @@ action_search_match_keyword (GtkAction *action,
*section = 4;
}
- while ((word = strsep (&words, " ")) != NULL)
+ words = g_strsplit (key, " ", 0);
+ for (word = &words[0]; *word; ++word)
{
- if (! strstr (label, word) &&
- (! tooltip || ! strstr (tooltip, word)))
+ if (! strstr (label, *word) &&
+ (! tooltip || ! strstr (tooltip, *word)))
{
matched = FALSE;
break;
}
}
- g_free (key_copy);
+ g_strfreev (words);
}
g_free (tooltip);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]