[lldb] A different fix for Domain Socket tests
authorPavel Labath <pavel@labath.sk>
Mon, 27 Sep 2021 15:57:22 +0000 (17:57 +0200)
committerPavel Labath <pavel@labath.sk>
Mon, 27 Sep 2021 16:00:27 +0000 (18:00 +0200)
we need to drop nuls from the end of the string.

lldb/source/Host/posix/DomainSocket.cpp

index 8138b6ff1dc4e98d8d950ed1c8c659dee9ecbea2..0a43d00e93ee10b7fddc1cc7723b741ec0d4d64e 100644 (file)
@@ -143,7 +143,7 @@ std::string DomainSocket::GetSocketName() const {
   llvm::StringRef name(saddr_un.sun_path + GetNameOffset(),
                        sock_addr_len - offsetof(struct sockaddr_un, sun_path) -
                            GetNameOffset());
-  name = name.drop_while([](char c) { return c == '\0'; });
+  name = name.rtrim('\0');
 
   return name.str();
 }