summarylogtreecommitdiffstats
path: root/fix-defaultconfig-search.patch
diff options
context:
space:
mode:
authorUwe Koloska2018-10-20 15:48:50 +0200
committerUwe Koloska2018-10-20 15:48:50 +0200
commit6a37a5ca2281a8e44d9fd3105ba899f8bb7bec9d (patch)
treed635a8c8136cd3337ef4e0b2fa00a35f210c20e1 /fix-defaultconfig-search.patch
parentbc2a120d260174cf93cd8d46c9660cf97b90cf71 (diff)
downloadaur-6a37a5ca2281a8e44d9fd3105ba899f8bb7bec9d.tar.gz
v1.8.8p5
Diffstat (limited to 'fix-defaultconfig-search.patch')
-rw-r--r--fix-defaultconfig-search.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/fix-defaultconfig-search.patch b/fix-defaultconfig-search.patch
new file mode 100644
index 00000000000..c1819e9eee0
--- /dev/null
+++ b/fix-defaultconfig-search.patch
@@ -0,0 +1,68 @@
+--- src/app-wavesurfer/wavesurfer__orig.tcl 2018-09-08 19:58:23.463734379 +0200
++++ src/app-wavesurfer/wavesurfer.tcl 2018-09-08 20:19:48.386838554 +0200
+@@ -461,6 +461,20 @@
+ }
+ }
+
++proc getConfigPath {name} {
++ set l [::wsurf::GetConfigurations]
++ # quote regexp sensible characters
++ set config [string map {+ \\+} $name]
++ set ind [lsearch -regexp $l ".*${config}\[\\w\\s\]*.conf"]
++ if {$ind != -1} {
++ set conf [lindex $l $ind]
++ } else {
++ set conf ""
++ }
++ return $conf
++}
++
++
+ proc OpenFile {args} {
+
+ puts [info level 0]
+@@ -507,13 +521,7 @@
+ ::SavePreferences
+ }
+ } else {
+- set l [::wsurf::GetConfigurations]
+- set ind [lsearch -regexp $l ".*$::wsurf::Info(Prefs,defaultConfig)\[\\w\\s\]*.conf"]
+- if {$ind != -1} {
+- set conf [lindex $l $ind]
+- } else {
+- set conf ""
+- }
++ set conf [getConfigPath $::wsurf::Info(Prefs,defaultConfig)]
+ }
+ if {$conf == "standard"} {
+ set conf ""
+@@ -907,13 +915,7 @@
+ ::SavePreferences
+ }
+ } else {
+- set l [::wsurf::GetConfigurations]
+- set ind [lsearch -regexp $l ".*$::wsurf::Info(Prefs,defaultConfig)\[\\w\\s\]*.conf"]
+- if {$ind != -1} {
+- set conf [lindex $l $ind]
+- } else {
+- set conf ""
+- }
++ set conf [getConfigPath $::wsurf::Info(Prefs,defaultConfig)]
+ }
+ if {$conf == ""} return
+ if {$conf == "standard"} {
+@@ -3439,11 +3441,10 @@
+ update idletasks
+
+ if {$surf(conf) == "unspecified" && $::wsurf::Info(Prefs,defaultConfig) != ""} {
+- set l [::wsurf::GetConfigurations]
+- set ind [lsearch -regexp $l ".*$::wsurf::Info(Prefs,defaultConfig)\[\\w\\s\]*.conf"]
+- if {$ind != -1} {
++ set conf [getConfigPath $::wsurf::Info(Prefs,defaultConfig)]
++ if {$conf ne ""} {
+ set surf(conf) {}
+- lappend surf(conf) [lindex $l $ind]
++ lappend surf(conf) $conf
+ } else {
+ set surf(conf) [list "unspecified"]
+ }