Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.

My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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;