diff options
Diffstat (limited to 'libfonts_confsplit__.c')
-rw-r--r-- | libfonts_confsplit__.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libfonts_confsplit__.c b/libfonts_confsplit__.c new file mode 100644 index 0000000..959a4b4 --- /dev/null +++ b/libfonts_confsplit__.c @@ -0,0 +1,44 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" +#ifndef TEST + + +char * +libfonts_confsplit__(char *line) +{ + size_t p, q; + + p = 0; + while (line[p] && line[p] != '=') + p += 1; + if (!line[p]) + return NULL; + + q = p; + while (q && isblank(line[q - 1])) + q -= 1; + if (!q) + return NULL; + line[q] = '\0'; + + p++; + while (isblank(line[p])) + p++; + if (!line[p]) + return NULL; + + return &line[p]; +} + + +#else + + +int +main(void) +{ + return 0; /* TODO add test */ +} + + +#endif |