| 700 | /* acl_vstring_rstrstr - locate byte in buffer */ |
| 701 | |
| 702 | char *acl_vstring_rstrstr(ACL_VSTRING *vp, const char *needle) |
| 703 | { |
| 704 | unsigned char *cp; |
| 705 | const unsigned char *np = 0, *needle_end; |
| 706 | |
| 707 | if (vp == NULL || needle == NULL || *needle == 0) { |
| 708 | return NULL; |
| 709 | } |
| 710 | |
| 711 | needle_end = (const unsigned char *) needle + strlen(needle) - 1; |
| 712 | |
| 713 | for (cp = (unsigned char *) acl_vstring_end(vp) - 1; |
| 714 | cp >= (unsigned char *) acl_vstring_str(vp); cp--) { |
| 715 | if (np) { |
| 716 | if (*cp == *np) { |
| 717 | if (--np < (const unsigned char *) needle) { |
| 718 | return (char *) cp; |
| 719 | } |
| 720 | } else { |
| 721 | np = 0; |
| 722 | } |
| 723 | } |
| 724 | if (!np && *cp == *needle_end) { |
| 725 | np = needle_end - 1; |
| 726 | if (np < (const unsigned char *) needle) { |
| 727 | return (char *) cp; |
| 728 | } |
| 729 | } |
| 730 | } |
| 731 | |
| 732 | return NULL; |
| 733 | } |
| 734 | |
| 735 | /* acl_vstring_rstrcasestr - locate byte in buffer */ |
| 736 |
no outgoing calls
no test coverage detected
searching dependent graphs…