New parser in use.

Warning : be prudent :)
This commit is contained in:
Philippe Pepiot
2010-04-13 19:57:02 +02:00
parent 611a5fc38d
commit 9b33623d33
10 changed files with 349 additions and 869 deletions

View File

@@ -290,3 +290,26 @@ parse_image_block(ImageAttr *im, char *str)
}
#endif /* HAVE_IMLIB */
char*
clean_value(char *str)
{
int i;
char c, *p;
if(!str || !(p = _strdup(str)))
return NULL;
/* Remove useless spaces */
for(; *p == ' '; ++p);
for(; *(p + strlen(p) - 1) == ' '; *(p + strlen(p) - 1) = '\0');
/* For string delimiter (" or ') */
if(((c = *p) == '"' || (c = *p) == '\'') && strchr(p + 1, c))
{
for(++p, i = 0; p[i] && p[i] != c; ++i);
p[i] = '\0';
}
return p;
}