diff --git a/src/xrt/auxiliary/util/u_var.cpp b/src/xrt/auxiliary/util/u_var.cpp index 8e132a141..84b21c1ea 100644 --- a/src/xrt/auxiliary/util/u_var.cpp +++ b/src/xrt/auxiliary/util/u_var.cpp @@ -41,6 +41,7 @@ class Obj { public: std::string name = {}; + std::string raw_name = {}; struct u_var_root_info info = {}; std::vector vars = {}; }; @@ -130,6 +131,7 @@ u_var_add_root(void *root, const char *c_name, bool suffix_with_number) } auto name = std::string(c_name); + auto raw_name = name; uint32_t count = 0; // Zero means no number. if (suffix_with_number) { @@ -142,7 +144,9 @@ u_var_add_root(void *root, const char *c_name, bool suffix_with_number) auto &obj = gTracker.map[(ptrdiff_t)root] = Obj(); obj.name = name; + obj.raw_name = raw_name; obj.info.name = obj.name.c_str(); + obj.info.raw_name = obj.raw_name.c_str(); obj.info.number = count; } diff --git a/src/xrt/auxiliary/util/u_var.h b/src/xrt/auxiliary/util/u_var.h index 140bfa2da..232ee0eb8 100644 --- a/src/xrt/auxiliary/util/u_var.h +++ b/src/xrt/auxiliary/util/u_var.h @@ -286,7 +286,10 @@ struct u_var_root_info //! The displayed name. const char *name; - //! The number of the window, or zero. + //! Raw name without any suffix. + const char *raw_name; + + //! The number of the window, or zero (name and raw_name are the same). uint32_t number; };