mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-15 17:31:56 +00:00
fixes for last commit
This commit is contained in:
@@ -179,6 +179,8 @@ static std::string parse_data(const gchar *data, bool colorize_output)
|
||||
case 'k':
|
||||
case 'y':
|
||||
sec_size = strlen(p);
|
||||
if (sec_size)
|
||||
res += std::string(p, sec_size);
|
||||
sec_size++;
|
||||
break;
|
||||
case 'W':
|
||||
|
||||
@@ -214,6 +214,7 @@ gchar* DictBase::GetWordData(guint32 idxitem_offset, guint32 idxitem_size)
|
||||
case 'l':
|
||||
case 'g':
|
||||
case 'x':
|
||||
case 'k':
|
||||
data_size += sizeof(gchar);
|
||||
break;
|
||||
case 'W':
|
||||
@@ -243,6 +244,7 @@ gchar* DictBase::GetWordData(guint32 idxitem_offset, guint32 idxitem_size)
|
||||
case 'l':
|
||||
case 'g':
|
||||
case 'x':
|
||||
case 'k':
|
||||
sec_size = strlen(p2)+1;
|
||||
memcpy(p1, p2, sec_size);
|
||||
p1+=sec_size;
|
||||
@@ -280,6 +282,7 @@ gchar* DictBase::GetWordData(guint32 idxitem_offset, guint32 idxitem_size)
|
||||
case 'l':
|
||||
case 'g':
|
||||
case 'x':
|
||||
case 'k':
|
||||
memcpy(p1, p2, sec_size);
|
||||
p1 += sec_size;
|
||||
*p1='\0';//add the end up '\0';
|
||||
@@ -348,6 +351,7 @@ bool DictBase::SearchData(std::vector<std::string> &SearchWords, guint32 idxitem
|
||||
case 'l':
|
||||
case 'g':
|
||||
case 'x':
|
||||
case 'k':
|
||||
for (j=0; j<nWord; j++)
|
||||
if (!WordFind[j] && strstr(p, SearchWords[j].c_str())) {
|
||||
WordFind[j] = true;
|
||||
@@ -377,6 +381,7 @@ bool DictBase::SearchData(std::vector<std::string> &SearchWords, guint32 idxitem
|
||||
case 'l':
|
||||
case 'g':
|
||||
case 'x':
|
||||
case 'k':
|
||||
sec_size = idxitem_size - (p-origin_data);
|
||||
for (j=0; j<nWord; j++)
|
||||
if (!WordFind[j] &&
|
||||
@@ -399,6 +404,7 @@ bool DictBase::SearchData(std::vector<std::string> &SearchWords, guint32 idxitem
|
||||
case 'l':
|
||||
case 'g':
|
||||
case 'x':
|
||||
case 'k':
|
||||
for (j=0; j<nWord; j++)
|
||||
if (!WordFind[j] && strstr(p, SearchWords[j].c_str())) {
|
||||
WordFind[j] = true;
|
||||
|
||||
Reference in New Issue
Block a user