diff options
author | Karl Williamson <khw@cpan.org> | 2017-04-24 20:27:24 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-11-06 12:50:06 -0700 |
commit | de62715824b6848c0aabf63dab4e7bcdc9945f9f (patch) | |
tree | 31c0022d32bb88c5d89ed9c39560d6525cf0ce52 /handy.h | |
parent | 8a0832a10f1561764283c17de01fc2ebf3097e09 (diff) | |
download | perl-de62715824b6848c0aabf63dab4e7bcdc9945f9f.tar.gz |
Add memBEGINPs() to core and use it
This macro is like memBEGINs(), but the 'P' signifies we want a proper
substring, meaning that the 2nd string parameter must not be the entire
first parameter.
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -495,6 +495,9 @@ Returns zero if non-equal, or non-zero if equal. #define memBEGINs(s1, l, s2) \ ( (l) >= sizeof(s2) - 1 \ && memEQ(s1, "" s2 "", sizeof(s2)-1)) +#define memBEGINPs(s1, l, s2) \ + ( (l) > sizeof(s2) - 1 \ + && memEQ(s1, "" s2 "", sizeof(s2)-1)) #define memENDs(s1, l, s2) \ ( (l) >= sizeof(s2) - 1 \ && memEQ(s1 + (l) - (sizeof(s2) - 1), "" s2 "", sizeof(s2)-1)) |