Source: dictd
Version: 1.12.1+dfsg-4
Severity: normal
Tags: patch

How to reproduce the problem.

Go to the terminal prompt. Enter the command

dict -h dict.bibleonline.ru --mime "ide"

and press enter. You will not receive any response from the DICT-server.
Now, if you enter another command:

dict -h dict.bibleonline.ru --mime "ide" "idea"

You will have the following result:
----------
1 definition found

From Греческо-русский лексикон Нового Завета [ell-rus_strong]:

 Content-type: text/html; charset=utf-8
 Content-transfer-encoding: 8bit

 2397  ἰδέα  idea
 вид (1. наружность, внешность;<BR>2. разновидность, тип);<BR><I
TITLE='синоним
' STYLE='COLOR: GREEN; CURSOR:DEFAULT'>син.</I> 3444 (μορφή), 4976
(σχῆμα).
----------

Make one more test:

dict -h dict.bibleonline.ru --mime - "ide" "idea"

----------
1 definition found

From Греческо-русский лексикон Нового Завета [ell-rus_strong]:

 Content-type: text/html; charset=utf-8
 Content-transfer-encoding: 8bit

 2396  ἴδε   ide
 вот, се, смотри, посмотри;<BR><I TITLE='второе лицо, единственное число,
повелительное наклонение, действительный залог от' STYLE='COLOR: GREEN;
CURSOR:DEFAULT'>2-е л. ед.ч. повел. действ. от</I> 1492 (εἰδῶ, οἶδα).
1 definition found

From Греческо-русский лексикон Нового Завета [ell-rus_strong]:

 Content-type: text/html; charset=utf-8
 Content-transfer-encoding: 8bit

 2397  ἰδέα  idea
 вид (1. наружность, внешность;<BR>2. разновидность, тип);<BR><I
TITLE='синоним' STYLE='COLOR: GREEN; CURSOR:DEFAULT'>син.</I> 3444 (μορφή),
4976 (σχῆμα).
----------

Conclusion: The element following the mime option (--mime) is treated as an
parameter for this option. While the mime option should not have a parameter.

This should fix it. Change line 1366 in dict.c to

{ "mime",       0, 0, 'M' },

My patch for solving this problem:

---------------------------------------------------------------- --- a/dict.c 2018-01-24 01:05:59.531250000 +0600
+++ b/dict.c 2018-01-24 01:07:03.343750000 +0600
@@ -1363,7 +1363,7 @@
      { "debug",      1, 0, 502 },
      { "pipesize",   1, 0, 504 },
      { "client",     1, 0, 505 },
-      { "mime",       1, 0, 'M' },
+      { "mime",       0, 0, 'M' },
      { "formatted",  0, 0, 'f' },
      { "flush",      0, 0, 'F' },
      { 0,            0, 0,  0  }
----------------------------------------------------------------
--- a/dict.c 2018-01-24 01:05:59.531250000 +0600
+++ b/dict.c    2018-01-24 01:07:03.343750000 +0600
@@ -1363,7 +1363,7 @@
      { "debug",      1, 0, 502 },
      { "pipesize",   1, 0, 504 },
      { "client",     1, 0, 505 },
-      { "mime",       1, 0, 'M' },
+      { "mime",       0, 0, 'M' },
      { "formatted",  0, 0, 'f' },
      { "flush",      0, 0, 'F' },
      { 0,            0, 0,  0  }

Reply via email to