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:
parent
441648bf5d
commit
cd02c345af
5 changed files with 82 additions and 28 deletions
14
Src/string.c
14
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue