diff --git a/src/auth.cpp b/src/auth.cpp index ab8f910..3a7438a 100644 --- a/src/auth.cpp +++ b/src/auth.cpp @@ -13,6 +13,10 @@ #include +#if defined(__OpenBSD__) +#include +#endif + #include "cacheutil.h" #include "config.h" #include "crypto.h" diff --git a/src/log.h b/src/log.h index 342ca36..63aa0eb 100644 --- a/src/log.h +++ b/src/log.h @@ -7,6 +7,10 @@ #pragma once +#if defined(__OpenBSD__) +#include +#endif + #include #include diff --git a/src/nmail.1 b/src/nmail.1 index 342785a..2f29370 100644 --- a/src/nmail.1 +++ b/src/nmail.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man. -.TH NMAIL "1" "September 2026" "nmail 5.16.3" "User Commands" +.TH NMAIL "1" "September 2026" "nmail 5.16.4" "User Commands" .SH NAME nmail \- ncurses mail .SH SYNOPSIS diff --git a/src/util.cpp b/src/util.cpp index ba1a332..f83abd5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -27,7 +27,13 @@ #include #include #include + +#if defined(__OpenBSD__) +#include +#include +#else #include +#endif #include #include @@ -141,6 +147,23 @@ std::string Util::ExpandPath(const std::string& p_Path) if ((p_Path.at(0) != '~') && ((p_Path.at(0) != '$'))) return p_Path; +#if defined(__OpenBSD__) + glob_t gl; + std::string rv; + if ((glob(p_Path.c_str(), GLOB_TILDE | GLOB_NOCHECK, nullptr, &gl) == 0) && (gl.gl_pathc > 0)) + { + rv = std::string(gl.gl_pathv[0]); + for (size_t i = 1; i < gl.gl_pathc; ++i) + { + rv += " " + std::string(gl.gl_pathv[i]); + } + globfree(&gl); + } + else + { + rv = p_Path; + } +#else wordexp_t exp; std::string rv; if ((wordexp(p_Path.c_str(), &exp, WRDE_NOCMD) == 0) && (exp.we_wordc > 0)) @@ -156,7 +179,7 @@ std::string Util::ExpandPath(const std::string& p_Path) { rv = p_Path; } - +#endif return rv; } diff --git a/src/version.cpp b/src/version.cpp index 0342a77..955da9a 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -9,7 +9,7 @@ #include "buildinfo.h" -#define NMAIL_VERSION "5.16.3" +#define NMAIL_VERSION "5.16.4" std::string Version::GetBuildOs() {