summaryrefslogtreecommitdiff
path: root/src/utils/copynpaste.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-29 13:01:12 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-29 21:35:02 +0300
commitae6627e0d13fa1fbf0b9f9226f3f257c3f12b9fd (patch)
tree3d71e76c2883d17419b946859bba10fb0d5b90b6 /src/utils/copynpaste.cpp
parentbbe6513b10f79ff25d04cd268c5224c3e84cc6ea (diff)
downloadmanaplus-ae6627e0d13fa1fbf0b9f9226f3f257c3f12b9fd.tar.gz
manaplus-ae6627e0d13fa1fbf0b9f9226f3f257c3f12b9fd.tar.bz2
manaplus-ae6627e0d13fa1fbf0b9f9226f3f257c3f12b9fd.tar.xz
manaplus-ae6627e0d13fa1fbf0b9f9226f3f257c3f12b9fd.zip
Fix paths for xsel and xdg-open on OpenBSD and FreeBSD.
Diffstat (limited to 'src/utils/copynpaste.cpp')
-rw-r--r--src/utils/copynpaste.cpp11
1 files changed, 9 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<char *>(nullptr));
}
else
{
- execl("/usr/bin/xsel", "xsel", p1,
+ execl(xselPath, "xsel", p1,
static_cast<char *>(nullptr));
}