Simplify get_window_by_desc()

The '#' case never worked anyway, so just remove it and simplify.
This commit is contained in:
Kevin Easton
2017-11-10 17:12:09 +11:00
parent 3ec950a7d7
commit c6f420b53d

View File

@@ -1175,21 +1175,13 @@ char *BX_get_status_by_refnum(unsigned refnum, unsigned line)
/* /*
* get_window_by_desc: Given either a refnum or a name, find that window * get_window_by_desc: Given either a refnum or a name, find that window
*/ */
Window *BX_get_window_by_desc (const char *stuff) Window *BX_get_window_by_desc(const char *desc)
{ {
Window *w = NULL; Window *w = get_window_by_name(desc);
do
{ if (!w && is_number(desc))
if ((w = get_window_by_name(stuff))) w = get_window_by_refnum(my_atol(desc));
break;
if (is_number(stuff) && (w = get_window_by_refnum(my_atol(stuff))))
break;
if (*stuff == '#')
{
stuff++;
continue;
}
} while (0);
return w; return w;
} }