From: Marek Olšák Date: Fri, 8 Jun 2018 23:49:22 +0000 (-0400) Subject: gallium/hud: = should rename the last added data source X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94178044d5d34e5bf65601d0b5da70d91284ec56;p=mesa.git gallium/hud: = should rename the last added data source Tested-by: Dieter Nützel --- diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index 61db98b4b03..233202453ee 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -1214,6 +1214,8 @@ hud_parse_env_var(struct hud_context *hud, struct pipe_screen *screen, } while ((num = parse_string(env, name_a)) != 0) { + bool added = true; + env += num; /* check for explicit location, size and etc. settings */ @@ -1386,6 +1388,7 @@ hud_parse_env_var(struct hud_context *hud, struct pipe_screen *screen, screen, name)) { fprintf(stderr, "gallium_hud: unknown driver query '%s'\n", name); fflush(stderr); + added = false; } } } @@ -1428,7 +1431,7 @@ hud_parse_env_var(struct hud_context *hud, struct pipe_screen *screen, env += num; strip_hyphens(s); - if (!LIST_IS_EMPTY(&pane->graph_list)) { + if (added && !LIST_IS_EMPTY(&pane->graph_list)) { struct hud_graph *graph; graph = LIST_ENTRY(struct hud_graph, pane->graph_list.prev, head); strncpy(graph->name, s, sizeof(graph->name)-1);