From ae6627e0d13fa1fbf0b9f9226f3f257c3f12b9fd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 29 Jan 2014 13:01:12 +0300 Subject: Fix paths for xsel and xdg-open on OpenBSD and FreeBSD. --- src/utils/copynpaste.cpp | 11 +++++++++-- src/utils/process.cpp | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp index 4e4f3c183..9506332d0 100644 --- a/src/utils/copynpaste.cpp +++ b/src/utils/copynpaste.cpp @@ -441,14 +441,21 @@ static bool runxsel(std::string& text, const char *p1, const char *p2) } close(fd[0]); } + + const char *const xselPath = +#if defined __OpenBSD__ || defined __FreeBSD__ || defined __DragonFly__ + "/usr/local/bin/xsel"; +#else + "/usr/bin/xsel"; +#endif if (p2) { - execl("/usr/bin/xsel", "xsel", p1, p2, + execl(xselPath, "xsel", p1, p2, static_cast(nullptr)); } else { - execl("/usr/bin/xsel", "xsel", p1, + execl(xselPath, "xsel", p1, static_cast(nullptr)); } diff --git a/src/utils/process.cpp b/src/utils/process.cpp index bb7488e33..d05c6a11a 100644 --- a/src/utils/process.cpp +++ b/src/utils/process.cpp @@ -260,6 +260,12 @@ bool openBrowser(std::string url) { return execFile("/usr/bin/open", "/usr/bin/open", url, ""); } +#elif defined __OpenBSD__ || defined __FreeBSD__ || defined __DragonFly__ +bool openBrowser(std::string url) +{ + return execFile("/usr/local/bin/xdg-open", + "/usr/local/bin/xdg-open", url, ""); +} #elif defined __linux__ || defined __linux bool openBrowser(std::string url) { -- cgit v1.2.3-60-g2f50