1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 04:40:59 +01:00

13280: NewImproved handling of colon modifiers w.r.t. paths

This commit is contained in:
Peter Stephenson 2001-02-19 10:26:52 +00:00
parent 441648bf5d
commit cd02c345af
5 changed files with 82 additions and 28 deletions

View file

@ -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;
}