base/sesson_label.h: do not prefix empty strings

Session_label prefix(a, b) shall not return ' -> b' or 'a -> '.

Issue #1787
This commit is contained in:
Emery Hemingway 2016-07-21 17:27:07 +02:00 committed by Christian Helmuth
parent 0b247f81f8
commit 1ae0357171

View File

@ -91,10 +91,10 @@ namespace Genode {
inline Session_label prefixed_label(String<N1> const &prefix,
String<N2> const &label)
{
if (!prefix.valid())
if (!prefix.valid() || prefix == "")
return Session_label(label.string());
if (!label.valid())
if (!label.valid() || label == "")
return Session_label(prefix.string());
char buf[Session_label::capacity()];