Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

#include <sys/time.h>

#if defined(__OpenBSD__)
#include <sys/wait.h>
#endif

#include "cacheutil.h"
#include "config.h"
#include "crypto.h"
Expand Down
4 changes: 4 additions & 0 deletions src/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

#pragma once

#if defined(__OpenBSD__)
#include <cstdarg>
#endif

#include <mutex>
#include <string>

Expand Down
2 changes: 1 addition & 1 deletion src/nmail.1
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 24 additions & 1 deletion src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
#include <netdb.h>
#include <termios.h>
#include <unistd.h>

#if defined(__OpenBSD__)
#include <string>
#include <sys/glob.h>
#else
#include <wordexp.h>
#endif

#include <sys/resource.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -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))
Expand All @@ -156,7 +179,7 @@ std::string Util::ExpandPath(const std::string& p_Path)
{
rv = p_Path;
}

#endif
return rv;
}

Expand Down
2 changes: 1 addition & 1 deletion src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "buildinfo.h"

#define NMAIL_VERSION "5.16.3"
#define NMAIL_VERSION "5.16.4"

std::string Version::GetBuildOs()
{
Expand Down
Loading