aboutsummaryrefslogtreecommitdiffhomepage
path: root/kill.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-20 20:39:31 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-20 20:39:31 -0700
commitb08fb866378693d2e75f17fdfe5e60401a29136a (patch)
treead1eb00129b96d284ab9ed4ca2de1cc176219777 /kill.cpp
parentb290fd33b973e573ffc7fc0c87be3ab431678b5f (diff)
Renamed env_vars to env_vars_snapshot_t
Cleanup of non-wcstring version of path_get_path
Diffstat (limited to 'kill.cpp')
-rw-r--r--kill.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/kill.cpp b/kill.cpp
index c5c0e2c3..f7d7cf0f 100644
--- a/kill.cpp
+++ b/kill.cpp
@@ -57,14 +57,9 @@ static wchar_t *cut_buffer=0;
*/
static int has_xsel()
{
- static int called=0;
- static int res = 0;
-
- if (!called) {
- wchar_t *path = path_get_path( L"xsel" );
- res = !!path;
- free(path);
- called = 1;
+ static int res=-1;
+ if (res < 0) {
+ res = !! path_get_path(L"xsel", NULL);
}
return res;