Helper function to return the text before the supplied string2 in string1. */
| 820 | |
| 821 | /* Helper function to return the text before the supplied string2 in string1. */ |
| 822 | static char *getPreTagText(const char *string1, const char *string2) |
| 823 | { |
| 824 | int n; |
| 825 | char *result, *tmpstr; |
| 826 | |
| 827 | if((tmpstr = strstr(string1, string2)) == NULL) return msStrdup(""); /* return an empty string */ |
| 828 | |
| 829 | n = strlen(string1) - strlen(tmpstr); |
| 830 | result = (char *) msSmallMalloc(n + 1); |
| 831 | strlcpy(result, string1, n+1); |
| 832 | |
| 833 | return result; |
| 834 | } |
| 835 | |
| 836 | /* Helper function to retunr the text after the supplied string2 in string1. */ |
| 837 | static char *getPostTagText(const char *string1, const char *string2) |
no test coverage detected