From cd02c345afdedd31b767530dfb826b56c61ac6d7 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 19 Feb 2001 10:26:52 +0000 Subject: 13280: NewImproved handling of colon modifiers w.r.t. paths --- Src/string.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Src/string.c') diff --git a/Src/string.c b/Src/string.c index 3dad89911..a0fc2ee8c 100644 --- a/Src/string.c +++ b/Src/string.c @@ -79,7 +79,7 @@ zhtricat(char const *s1, char const *s2, char const *s3) char *ptr; size_t l1 = strlen(s1); size_t l2 = strlen(s2); - + ptr = (char *)zhalloc(l1 + l2 + strlen(s3) + 1); strcpy(ptr, s1); strcpy(ptr + l1, s2); @@ -133,3 +133,15 @@ appstr(char *base, char const *append) { return strcat(realloc(base, strlen(base) + strlen(append) + 1), append); } + +/* Return a pointer to the last character of a string, + unless the string is empty. */ + +/**/ +mod_export char * +strend(char *str) +{ + if (*str == '\0') + return str; + return str + strlen (str) - 1; +} -- cgit 1.4.1