summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0c479e3)
raw | patch | inline | side by side (parent: 0c479e3)
author | Fredrik Lanker <fredrik.lanker@gmail.com> | |
Sat, 3 Jan 2009 11:15:28 +0000 (12:15 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 3 Jan 2009 11:15:28 +0000 (12:15 +0100) |
It uses g_regex_match_simple() in glib and is case insensitive. The
search in the NCMPC_MINI case is unchanged.
search in the NCMPC_MINI case is unchanged.
NEWS | patch | blob | history | |
src/match.c | patch | blob | history |
index 92b426eaad3bdd090f54b4d6d9c7ef2bf6e75b11..398df80a6669c2421f9a0df0677ac3a1de2fda67 100644 (file)
--- a/NEWS
+++ b/NEWS
* new --disable-multibyte configure option; this allows you to
disable wide character support, retaining multibyte character
support
+ * search with regular expressions
ncmpc 0.12 - 2008-12-05
diff --git a/src/match.c b/src/match.c
index 0bd8b3644b96c832f892a050923ee6730760ce51..c97cde5109483639f8d04f123a393b2bf9146e8a 100644 (file)
--- a/src/match.c
+++ b/src/match.c
char *line_folded = locale_casefold(line);
char *needle_folded = locale_casefold(needle);
- bool ret = strstr(line_folded, needle_folded) != NULL;
+ bool ret = (bool)g_regex_match_simple((const gchar*)needle_folded,
+ (const gchar*)line_folded,
+ G_REGEX_CASELESS | G_REGEX_DOTALL | G_REGEX_OPTIMIZE,
+ 0);
g_free(line_folded);
g_free(needle_folded);