Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
- index c05ebca..cb9444a 100644
- --- a/apps/gui/skin_engine/skin_parser.c
- +++ b/apps/gui/skin_engine/skin_parser.c
- @@ -1387,6 +1387,44 @@ static int parse_token(const char *wps_bufptr, struct wps_data *wps_data)
- return skip;
- }
- +static int find_false_branch(const char *wps_bufptr)
- +{
- + const char *buf = wps_bufptr;
- + int level = 1;
- + do
- + {
- + if (*buf == '<')
- + level++;
- + if (*buf == '>')
- + level--;
- + if (*buf == '|' && level == 1)
- + {
- + buf++;
- + break;
- + }
- + } while (buf && *buf++);
- +
- + printf("level %d\n", buf - wps_bufptr);
- + printf("buf: %8s\n", buf);
- + return buf - wps_bufptr;
- +}
- +
- +static int check_feature_tag(const char *wps_bufptr, const int type)
- +{
- + switch (type)
- + {
- + case WPS_TOKEN_RTC_PRESENT:
- +#if CONFIG_RTC && 0
- + printf("Hi\n");
- + return 0;
- +#else
- + return find_false_branch(wps_bufptr);
- +#endif
- + default: return 0;
- + }
- +}
- +
- +
- /* Parses the WPS.
- data is the pointer to the structure where the parsed WPS should be stored.
- It is initialised.
- @@ -1466,7 +1504,7 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug)
- fail = PARSE_FAIL_COND_SYNTAX_ERROR;
- break;
- }
- -
- + wps_bufptr += check_feature_tag(wps_bufptr, data->tokens[data->num_tokens-1].type);
- data->tokens[data->num_tokens].type = WPS_TOKEN_CONDITIONAL_START;
- lastcond[level] = data->num_tokens++;
- break;
Add Comment
Please, Sign In to add comment