MCPcopy Create free account
hub / github.com/MapServer/MapServer / getPreTagText

Function getPreTagText

maptemplate.c:822–834  ·  view source on GitHub ↗

Helper function to return the text before the supplied string2 in string1. */

Source from the content-addressed store, hash-verified

820
821/* Helper function to return the text before the supplied string2 in string1. */
822static 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. */
837static char *getPostTagText(const char *string1, const char *string2)

Callers 2

processFeatureTagFunction · 0.85
processResultSetTagFunction · 0.85

Calls 3

msStrdupFunction · 0.85
msSmallMallocFunction · 0.85
strlcpyFunction · 0.85

Tested by

no test coverage detected