aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Hilbrich <torsten.hilbrich@gmx.net>2011-08-27 21:06:53 +0200
committerTorsten Hilbrich <torsten.hilbrich@gmx.net>2011-08-27 21:06:53 +0200
commit0e744319215aaf1c03f7d88819d5ebdd79b1a57f (patch)
tree2a5f1933a461723b8eaf1fb651a210b8dc297fa7
parentd21375929c86079424cfbdee97854fb3e1640b7b (diff)
Encode dictionary name before use
avoid invoking concat on a nominally multibyte dictionary name, to avoid double-encoding the search term when consulting a single dictionary. Fix taken from Debian package.
-rwxr-xr-xdictionary.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/dictionary.el b/dictionary.el
index 1240f3b..72e633d 100755
--- a/dictionary.el
+++ b/dictionary.el
@@ -638,7 +638,9 @@ This function knows about the special meaning of quotes (\")"
"The workhorse for doing the search"
(message "Searching for %s in %s" word dictionary)
- (dictionary-send-command (concat "define " dictionary " \""
+ (dictionary-send-command (concat "define "
+ (dictionary-encode-charset dictionary "")
+ " \""
(dictionary-encode-charset word dictionary)
"\""))
@@ -862,7 +864,8 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
(equal dictionary "!"))
(dictionary-store-positions)
(message "Requesting more information on %s" dictionary)
- (dictionary-send-command (concat "show info " dictionary))
+ (dictionary-send-command
+ (concat "show info " (dictionary-encode-charset dictionary "")))
(let ((reply (dictionary-read-reply-and-split)))
(message nil)
(if (dictionary-check-reply reply 550)
@@ -951,8 +954,9 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
(message "Lookup matching words for %s in %s using %s"
word dictionary strategy)
(dictionary-send-command
- (concat "match " dictionary " "
- strategy " \"" (dictionary-encode-charset word "") "\""))
+ (concat "match " (dictionary-encode-charset dictionary "") " "
+ (dictionary-encode-charset strategy "") " \""
+ (dictionary-encode-charset word "") "\""))
(let ((reply (dictionary-read-reply-and-split)))
(message nil)
(if (dictionary-check-reply reply 550)