1 From 830d0db80f2fce09e12c117f8338b8e4b05866ff Mon Sep 17 00:00:00 2001
2 From: Pascal Winkelmann <pascal@wnklmnn.de>
3 Date: Tue, 19 May 2020 10:28:31 +0200
4 Subject: [PATCH] fixpaths
7 KeePass/Native/NativeMethods.Unix.cs | 2 +-
8 KeePass/UI/UISystemFonts.cs | 2 +-
9 KeePass/Util/AppLocator.cs | 2 +-
10 KeePass/Util/ClipboardUtil.Unix.cs | 14 +++++++-------
11 KeePassLib/Native/ClipboardU.cs | 2 +-
12 KeePassLib/Native/NativeLib.cs | 2 +-
13 KeePassLib/Utility/MonoWorkarounds.cs | 4 ++--
14 7 files changed, 14 insertions(+), 14 deletions(-)
16 diff --git a/KeePass/Native/NativeMethods.Unix.cs b/KeePass/Native/NativeMethods.Unix.cs
17 index 4c47258..79cfdb2 100644
18 --- a/KeePass/Native/NativeMethods.Unix.cs
19 +++ b/KeePass/Native/NativeMethods.Unix.cs
20 @@ -130,7 +130,7 @@ namespace KeePass.Native
23 Application.DoEvents(); // E.g. for clipboard updates
24 - string strOutput = NativeLib.RunConsoleApp("xdotool", strParams);
25 + string strOutput = NativeLib.RunConsoleApp("@xdotool@", strParams);
26 Application.DoEvents(); // E.g. for clipboard updates
27 return (strOutput ?? string.Empty);
29 diff --git a/KeePass/UI/UISystemFonts.cs b/KeePass/UI/UISystemFonts.cs
30 index 08d6134..2bfa4a2 100644
31 --- a/KeePass/UI/UISystemFonts.cs
32 +++ b/KeePass/UI/UISystemFonts.cs
33 @@ -188,7 +188,7 @@ namespace KeePass.UI
35 private static void UbuntuLoadFonts()
37 - string strDef = NativeLib.RunConsoleApp("gsettings",
38 + string strDef = NativeLib.RunConsoleApp("@gsettings@",
39 "get org.gnome.desktop.interface font-name");
40 if(strDef == null) return;
42 diff --git a/KeePass/Util/AppLocator.cs b/KeePass/Util/AppLocator.cs
43 index af02803..8a32c9d 100644
44 --- a/KeePass/Util/AppLocator.cs
45 +++ b/KeePass/Util/AppLocator.cs
46 @@ -468,7 +468,7 @@ namespace KeePass.Util
47 if(NativeLib.GetPlatformID() == PlatformID.MacOSX)
48 strOpt = string.Empty; // FR 3535696
50 - string str = NativeLib.RunConsoleApp("whereis", strOpt + strApp);
51 + string str = NativeLib.RunConsoleApp("@whereis@", strOpt + strApp);
52 if(string.IsNullOrEmpty(str)) return null;
54 int iSep = str.IndexOf(':');
55 diff --git a/KeePass/Util/ClipboardUtil.Unix.cs b/KeePass/Util/ClipboardUtil.Unix.cs
56 --- a/KeePass/Util/ClipboardUtil.Unix.cs
57 +++ b/KeePass/Util/ClipboardUtil.Unix.cs
59 // "-out -selection clipboard");
60 // if(str != null) return str;
62 - string str = NativeLib.RunConsoleApp("xsel",
63 + string str = NativeLib.RunConsoleApp("@xsel@",
64 "--output --clipboard", null, XSelFlags);
65 if(str != null) return str;
68 if(string.IsNullOrEmpty(str))
70 // xsel with an empty input can hang, thus use --clear
71 - if(NativeLib.RunConsoleApp("xsel", "--clear --primary",
72 + if(NativeLib.RunConsoleApp("@xsel@", "--clear --primary",
73 null, XSelFlags) != null)
75 - NativeLib.RunConsoleApp("xsel", "--clear --clipboard",
76 + NativeLib.RunConsoleApp("@xsel@", "--clear --clipboard",
83 // xsel does not support --primary and --clipboard together
84 - if(NativeLib.RunConsoleApp("xsel", "--input --primary",
85 + if(NativeLib.RunConsoleApp("@xsel@", "--input --primary",
86 str, XSelFlags) != null)
88 - NativeLib.RunConsoleApp("xsel", "--input --clipboard",
89 + NativeLib.RunConsoleApp("@xsel@", "--input --clipboard",
93 diff --git a/KeePassLib/Native/ClipboardU.cs b/KeePassLib/Native/ClipboardU.cs
94 index 291c51d..3c76380 100644
95 --- a/KeePassLib/Native/ClipboardU.cs
96 +++ b/KeePassLib/Native/ClipboardU.cs
97 @@ -27,7 +27,7 @@ namespace KeePassLib.Native
99 internal static class ClipboardU
101 - internal const string XSel = "xsel";
102 + internal const string XSel = "@xsel@";
103 private const string XSelV = "--version";
104 private const string XSelR = "--output --clipboard";
105 private const string XSelC = "--clear --clipboard";
106 diff --git a/KeePassLib/Native/NativeLib.cs b/KeePassLib/Native/NativeLib.cs
107 index 2d227a3..243f4ee 100644
108 --- a/KeePassLib/Native/NativeLib.cs
109 +++ b/KeePassLib/Native/NativeLib.cs
110 @@ -143,7 +143,7 @@ namespace KeePassLib.Native
111 // Mono returns PlatformID.Unix on MacOS, workaround this
112 if(g_platID.Value == PlatformID.Unix)
114 - if((RunConsoleApp("uname", null) ?? string.Empty).Trim().Equals(
115 + if((RunConsoleApp("@uname@", null) ?? string.Empty).Trim().Equals(
116 "Darwin", StrUtil.CaseIgnoreCmp))
117 g_platID = PlatformID.MacOSX;
119 diff --git a/KeePassLib/Utility/MonoWorkarounds.cs b/KeePassLib/Utility/MonoWorkarounds.cs
120 index e20bb3a..4fd875b 100644
121 --- a/KeePassLib/Utility/MonoWorkarounds.cs
122 +++ b/KeePassLib/Utility/MonoWorkarounds.cs
123 @@ -41,7 +41,7 @@ namespace KeePassLib.Utility
125 public static class MonoWorkarounds
127 - private const string AppXDoTool = "xdotool";
128 + private const string AppXDoTool = "@xdotool@";
130 private static Dictionary<uint, bool> g_dForceReq = new Dictionary<uint, bool>();
131 private static Thread g_thFixClip = null;
132 @@ -356,7 +356,7 @@ namespace KeePassLib.Utility
134 // else { Debug.Assert(false); }
136 - string strWmClass = (NativeLib.RunConsoleApp("xprop",
137 + string strWmClass = (NativeLib.RunConsoleApp("@xprop@",
138 "-id " + strHandle + " WM_CLASS") ?? string.Empty);
140 if(strWmClass.IndexOf("\"" + PwDefs.ResClass + "\"",