From 0d9a12a7e4b4752bf08dd957a27e9682c6acca92 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Fri, 26 Oct 2018 20:18:58 +0300 Subject: [PATCH] DictD: Fix dictionary name recognition for dictionaries from freedict.org (issue #1075) --- dictdfiles.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dictdfiles.cc b/dictdfiles.cc index 23749421..d503fc94 100644 --- a/dictdfiles.cc +++ b/dictdfiles.cc @@ -718,7 +718,11 @@ vector< sptr< Dictionary::Class > > makeDictionaries( char * articleBody = dict_data_read_( dz, articleOffset, articleSize, 0, 0 ); if ( articleBody ) { - char * eol = strchr( articleBody, '\n' ); // skip the first line (headword itself) + char * eol; + if ( !strncmp( articleBody, "00databaseshort", 15 ) || !strncmp( articleBody, "00-database-short", 17 ) ) + eol = strchr( articleBody, '\n' ); // skip the first line (headword itself) + else + eol = articleBody; // No headword itself if ( eol ) { while( *eol && Utf8::isspace( *eol ) ) ++eol; // skip spaces