diff options
Diffstat (limited to 'utils/newparser')
-rw-r--r-- | utils/newparser/handle_tags.c | 18 | ||||
-rw-r--r-- | utils/newparser/skin_render.c | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/utils/newparser/handle_tags.c b/utils/newparser/handle_tags.c index 3e49960686..a725a52396 100644 --- a/utils/newparser/handle_tags.c +++ b/utils/newparser/handle_tags.c | |||
@@ -123,7 +123,22 @@ int handle_tree(struct skin *skin, struct skin_element* tree, struct line *line) | |||
123 | int counter; | 123 | int counter; |
124 | while (element) | 124 | while (element) |
125 | { | 125 | { |
126 | if (element->type == LINE) | 126 | if (element->type == VIEWPORT) |
127 | { | ||
128 | struct skin_element *next; | ||
129 | /* parse the viewport */ | ||
130 | /* if the next element is a LINE we need to set it to eat the line ending */ | ||
131 | next = element->children[0]; | ||
132 | if (element->tag && next->type == LINE && | ||
133 | element->line == next->line) | ||
134 | { | ||
135 | struct line *line = (struct line*)malloc(sizeof(struct line)); | ||
136 | line->update_mode = 0; | ||
137 | line->eat_line_ending = true; | ||
138 | next->data = line; | ||
139 | } | ||
140 | } | ||
141 | else if (element->type == LINE && !element->data) | ||
127 | { | 142 | { |
128 | struct line *line = (struct line*)malloc(sizeof(struct line)); | 143 | struct line *line = (struct line*)malloc(sizeof(struct line)); |
129 | line->update_mode = 0; | 144 | line->update_mode = 0; |
@@ -164,6 +179,7 @@ int handle_tree(struct skin *skin, struct skin_element* tree, struct line *line) | |||
164 | int ret = handle_tree(skin, element->children[counter], current_line); | 179 | int ret = handle_tree(skin, element->children[counter], current_line); |
165 | counter++; | 180 | counter++; |
166 | } | 181 | } |
182 | /* *probably* set current_line to NULL here */ | ||
167 | element = element->next; | 183 | element = element->next; |
168 | } | 184 | } |
169 | return 0; | 185 | return 0; |
diff --git a/utils/newparser/skin_render.c b/utils/newparser/skin_render.c index dfcc4b89ea..f39e6f6c45 100644 --- a/utils/newparser/skin_render.c +++ b/utils/newparser/skin_render.c | |||
@@ -111,7 +111,7 @@ void skin_render_viewport(struct skin_element* viewport, bool draw_tags) | |||
111 | func(line, linebuf, sizeof(linebuf), line_number); | 111 | func(line, linebuf, sizeof(linebuf), line_number); |
112 | if (draw_tags) | 112 | if (draw_tags) |
113 | { | 113 | { |
114 | printf("%s", linebuf); | 114 | printf("[%d]%s", line_number, linebuf); |
115 | if (!((struct line*)line->data)->eat_line_ending) | 115 | if (!((struct line*)line->data)->eat_line_ending) |
116 | { | 116 | { |
117 | printf("\n"); | 117 | printf("\n"); |