git-gui: Don't use '$$cr master' with aspell earlier than 0.60
Apparently aspell 0.50 does not recognize "$$cr master" as a command, but instead tries to offer suggestions for how to correctly spell the word "cr". This is not quite what we are after when we want the name of the current dictionary. Instead of locking up git-gui waiting for a response that may never come back from aspell we avoid sending this command if the binary we have started claims to be before version 0.60. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Apr 23, 2008 at 21:34 UTC
ddc360314544a21638fd0658218bbc37aafedd6f
1 file changed
+10
-4
lib/spellcheck.tcl
+10
-4
@@ -84,13 +84,19 @@ method _connect {pipe_fd} {
84
regexp \
85
{International Ispell Version .* \(but really (Aspell .*?)\)$} \
86
$s_version _junk s_version
87
+ regexp {^Aspell (\d)+\.(\d+)} $s_version _junk major minor
88
89
puts $pipe_fd ! ; # enable terse mode
89
- puts $pipe_fd {$$cr master} ; # fetch the language
90
- flush $pipe_fd
90
92
- gets $pipe_fd s_lang
93
- regexp {[/\\]([^/\\]+)\.[^\.]+$} $s_lang _ s_lang
91
+ # fetch the language
92
+ if {$major > 0 || ($major == 0 && $minor >= 60)} {
93
+ puts $pipe_fd {$$cr master}
94
+ flush $pipe_fd
95
+ gets $pipe_fd s_lang
96
+ regexp {[/\\]([^/\\]+)\.[^\.]+$} $s_lang _ s_lang
97
+ } else {
98
+ set s_lang {}
99
+ }
100
101
if {$::default_config(gui.spellingdictionary) eq {}
102
&& [get_config gui.spellingdictionary] eq {}} {