diff options
author | Josh Stone <jistone@redhat.com> | 2010-03-11 19:19:33 -0800 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2010-03-11 19:19:33 -0800 |
commit | 60d985370e63cb3b4c68489fc54276d8ac2b921b (patch) | |
tree | 2731ffe47f8e619b6fabcacf451275d49a3486fd /cache.cxx | |
parent | 0da46fcdec144f944838350f08f59a36b8709e90 (diff) | |
download | systemtap-steved-60d985370e63cb3b4c68489fc54276d8ac2b921b.tar.gz systemtap-steved-60d985370e63cb3b4c68489fc54276d8ac2b921b.tar.xz systemtap-steved-60d985370e63cb3b4c68489fc54276d8ac2b921b.zip |
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.
Diffstat (limited to 'cache.cxx')
-rw-r--r-- | cache.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -81,7 +81,7 @@ add_script_to_cache(systemtap_session& s) copy_file(module_src_path + ".sgn", s.hash_path + ".sgn", verbose); string c_dest_path = s.hash_path; - if (c_dest_path.rfind(".ko") == (c_dest_path.size() - 3)) + if (endswith(c_dest_path, ".ko")) c_dest_path.resize(c_dest_path.size() - 3); c_dest_path += ".c"; @@ -140,7 +140,7 @@ get_script_from_cache(systemtap_session& s) string c_src_path = s.hash_path; int fd_module, fd_c; - if (c_src_path.rfind(".ko") == (c_src_path.size() - 3)) + if (endswith(c_src_path, ".ko")) c_src_path.resize(c_src_path.size() - 3); c_src_path += ".c"; |