Added path_to_plain_ascii for use by driver-ssl
This commit is contained in:
@@ -32,6 +32,16 @@ const int INVALID_SOCKET = -1;
|
||||
|
||||
struct termios orig_termios;
|
||||
|
||||
// OpenSSL requires plain ascii pathnames. Returns empty string
|
||||
// if the path cannot be converted to plain ascii.
|
||||
std::string path_to_plain_ascii(const std::filesystem::path &path) {
|
||||
std::string s = path.native();
|
||||
for (char c : s) {
|
||||
if ((c < 1) || (c > 127)) return "";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
std::string strerror_str(int err) {
|
||||
char errbuf[256];
|
||||
return strerror_r(err, errbuf, 256);
|
||||
|
||||
Reference in New Issue
Block a user