From 60d985370e63cb3b4c68489fc54276d8ac2b921b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 11 Mar 2010 19:19:33 -0800 Subject: Add startswith/endswith helpers Inspired by the Python equivalents, these new utility functions just make it a little cleaner to match at the beginning or end of a string. --- buildrun.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'buildrun.cxx') diff --git a/buildrun.cxx b/buildrun.cxx index 084022bf..0140c69f 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -629,7 +629,7 @@ make_typequery(systemtap_session& s, string& module) int rc; string new_module; vector headers; - bool kernel = (module.compare(0, 6, "kernel") == 0); + bool kernel = startswith(module, "kernel"); for (size_t end, i = kernel ? 6 : 0; i < module.size(); i = end + 1) { -- cgit