diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-26 23:23:32 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-26 23:23:32 +0000 |
commit | 8acc6307bf52e5e67f41597e062cb9151162f80e (patch) | |
tree | 5414cd9e7f7b0482293c99fedf27a4359d2883c2 /libs | |
parent | 047d4e45f6d26d54d2019ff3d12e372fae3f2e22 (diff) |
libs/web: fix template parsing of default texts in i18n expressions
Diffstat (limited to 'libs')
-rw-r--r-- | libs/web/src/template_parser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/web/src/template_parser.c b/libs/web/src/template_parser.c index 58de5bb77..9618919b3 100644 --- a/libs/web/src/template_parser.c +++ b/libs/web/src/template_parser.c @@ -58,12 +58,12 @@ static char *strfind(char *haystack, int hslen, const char *needle, int ndlen) return NULL; } -/* - * Inspect current read buffer and find the number of "vague" characters at the end +/* + * Inspect current read buffer and find the number of "vague" characters at the end * which could indicate an opening token. Returns the number of "vague" chars. * The last continuous sequence of whitespace, optionally followed by a "<" is * treated as "vague" because whitespace may be discarded if the upcoming opening - * token indicates pre-whitespace-removal ("<%-"). A single remaining "<" char + * token indicates pre-whitespace-removal ("<%-"). A single remaining "<" char * can't be differentiated from an opening token ("<%"), so it's kept to be processed * in the next cycle. */ @@ -186,8 +186,8 @@ static const char * generate_expression(struct template_parser *data, size_t *sz } } - /* Found whitespace in i18n expression, raise flag */ - else if( isspace(data->out[i]) && (data->type == T_TYPE_I18N) ) + /* Found first whitespace in i18n expression, raise flag */ + else if( isspace(data->out[i]) && (data->type == T_TYPE_I18N) && (i18n_hasdef == 0) ) { i18n_hasdef = 1; } |