mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
NetworkTable: Don't prefix path with / if key is empty.
This avoids NetworkTable("").putValue("foo") resulting in key "//foo".
This commit is contained in:
@@ -46,8 +46,10 @@ void NetworkTable::SetIPAddress(StringRef address) {
|
||||
std::shared_ptr<NetworkTable> NetworkTable::GetTable(StringRef key) {
|
||||
if (!s_running) Initialize();
|
||||
llvm::SmallString<128> path;
|
||||
path += PATH_SEPARATOR_CHAR;
|
||||
path += key;
|
||||
if (!key.empty()) {
|
||||
path += PATH_SEPARATOR_CHAR;
|
||||
path += key;
|
||||
}
|
||||
return std::make_shared<NetworkTable>(path, private_init());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user