mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-05 23:48:44 +02:00
Bug 548612 – g_strstr_len() should use memmem when available
2008-08-28 Bastien Nocera <hadess@hadess.net> Bug 548612 – g_strstr_len() should use memmem when available * configure.in: detect whether memmem is available in the C library * glib/gstrfuncs.c (g_strstr_len): use memmem for g_strstr_len() if available in it's available, as it could be optimised by the C library * tests/string-test.c (main): Add a few tests for g_strstr_len() svn path=/trunk/; revision=7407
This commit is contained in:
committed by
Bastien Nocera
parent
32947a3b4a
commit
5e2a6047ea
@@ -307,6 +307,11 @@ main (int argc,
|
||||
g_assert (strcmp (tmp_string, "b a") == 0);
|
||||
g_free (tmp_string);
|
||||
|
||||
tmp_string = g_strdup (GLIB_TEST_STRING);
|
||||
g_assert (g_strstr_len (tmp_string, 4, "rado") == NULL);
|
||||
g_assert (g_strstr_len (tmp_string, -1, "rado") == tmp_string + 5);
|
||||
g_free (tmp_string);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user