Imported Upstream version 2.6.4
This commit is contained in:
parent
fad6ced6f6
commit
fefe62b2bd
257 changed files with 6020 additions and 1394 deletions
|
|
@ -527,11 +527,28 @@ char *rtrim(char *in, const char sep)
|
|||
{
|
||||
char *p;
|
||||
|
||||
p = &in[strlen(in) - 1];
|
||||
if (in) {
|
||||
p = &in[strlen(in) - 1];
|
||||
|
||||
while ((p >= in) && (*p == sep))
|
||||
*p-- = '\0';
|
||||
|
||||
while ((p >= in) && (*p == sep))
|
||||
*p-- = '\0';
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
/* modify in - strip all leading instances of <sep> */
|
||||
char* ltrim(char *in, const char sep)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (in) {
|
||||
p = in;
|
||||
|
||||
while ((*p != '\0') && (*p == sep))
|
||||
*p++ = *in++;
|
||||
|
||||
p = '\0';
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue