Imported Upstream version 2.6.4

This commit is contained in:
Arnaud Quette 2012-06-01 15:55:19 +02:00
parent fad6ced6f6
commit fefe62b2bd
257 changed files with 6020 additions and 1394 deletions

View file

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