summaryrefslogtreecommitdiffstats
path: root/desktop/wmxss/libexecpath.diff
diff options
context:
space:
mode:
author B. Watson2016-08-16 09:43:04 +0200
committer Willy Sudiarto Raharjo2016-08-20 02:50:03 +0200
commit787c93b8a8208711b3f5cba99e89e1f736e7874e (patch)
tree3c8cfb7d93a08dcb489fa0dd4c031fb704fb3b1c /desktop/wmxss/libexecpath.diff
parent9ea8ca2f3e46cddd21def8169693e13e39442e93 (diff)
downloadslackbuilds-787c93b8a8208711b3f5cba99e89e1f736e7874e.tar.gz
desktop/wmxss: New maintainer, minor fixes.
Diffstat (limited to 'desktop/wmxss/libexecpath.diff')
-rw-r--r--desktop/wmxss/libexecpath.diff59
1 files changed, 59 insertions, 0 deletions
diff --git a/desktop/wmxss/libexecpath.diff b/desktop/wmxss/libexecpath.diff
new file mode 100644
index 0000000000..9dffc2f65d
--- /dev/null
+++ b/desktop/wmxss/libexecpath.diff
@@ -0,0 +1,59 @@
+diff -Naur wmxss-0.1.orig/Src/wmxss.c wmxss-0.1/Src/wmxss.c
+--- wmxss-0.1.orig/Src/wmxss.c 1999-08-11 17:29:02.000000000 -0400
++++ wmxss-0.1/Src/wmxss.c 2016-08-16 03:37:20.306233811 -0400
+@@ -43,6 +43,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <time.h>
++#include <limits.h>
+ #include <X11/X.h>
+ #include <X11/xpm.h>
+ #include "xutils.h"
+@@ -71,7 +72,8 @@
+ int GotFirstClick3, GotDoubleClick3;
+ int DblClkDelay;
+ int HasExecute;
+-char ExecuteCommand[1024];
++char ExecuteCommand[PATH_MAX];
++char env_path[PATH_MAX];
+
+
+
+@@ -93,8 +95,16 @@
+
+ XEvent event;
+ int n;
+- char Command[512];
++ char Command[PATH_MAX];
++ char *env_path, new_path[PATH_MAX];
+
++ /* 20160816 bkw: export PATH=/usr/libexec/xscreensaver:$PATH */
++ if( !(env_path = getenv("PATH")) )
++ strcpy(new_path, "PATH=/usr/libexec/xscreensaver");
++ else
++ snprintf(new_path, PATH_MAX - 1, "PATH=/usr/libexec/xscreensaver:%s", env_path);
++
++ putenv(new_path);
+
+ /*
+ * Parse any command line arguments.
+@@ -113,7 +123,7 @@
+
+
+ if (HasExecute){
+- sprintf(Command, "%s -window-id 0x%x &", ExecuteCommand, (int)iconwin);
++ snprintf(Command, PATH_MAX - 1, "%s -window-id 0x%x &", ExecuteCommand, (int)iconwin);
+ system(Command);
+ }
+
+@@ -245,8 +255,8 @@
+ print_usage();
+ exit(-1);
+ }
+- strcpy(ExecuteCommand, argv[++i]);
+- HasExecute = 1;
++ strcpy(ExecuteCommand, argv[++i]);
++ HasExecute = 1;
+
+ } else {
+