diff --git a/VERSION b/VERSION index 7699cc25..bd2e69cc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -a12-195-g7cc0f7cb99+1 \ No newline at end of file +a12-196-gce9b94e93d+1 \ No newline at end of file diff --git a/common/src/option.c b/common/src/option.c index cef3ed0f..c00633ee 100644 --- a/common/src/option.c +++ b/common/src/option.c @@ -458,6 +458,9 @@ bool option_load(const char * filename) goto exit; } + //rtrim + while(nameLen > 1 && (name[nameLen-1] == ' ' || name[nameLen-1] == '\t')) + --nameLen; name[nameLen] = '\0'; expectValue = true; @@ -480,6 +483,10 @@ bool option_load(const char * filename) } line = false; + //ltrim + if (*len == 0 && (c == ' ' || c == '\t')) + break; + if (*len % 32 == 0) *p = realloc(*p, *len + 32 + 1); (*p)[(*len)++] = c;