cheusov / dictd

Client/server software, human language dictionary databases, and tools supporting the DICT protocol (RFC 2229)
71 stars 10 forks source link

dict: MIME OPTION problem #1

Open Michahel opened 8 years ago

Michahel commented 8 years ago

The version number of the dict: 1.12.1/rf

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:DEFAUL
T'>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 does not have a parameter.

Michahel commented 6 years ago

This should fix it. Change line 1366 in dict.c to { "mime", 0, 0, 'M' },