mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 01:26:39 -04:00
textproc/stardict3: Fix build with newer glib20
PR: 281083
This commit is contained in:
parent
90e561b090
commit
55bddb6f7c
2 changed files with 38 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
PORTNAME= stardict
|
PORTNAME= stardict
|
||||||
PORTVERSION= 3.0.6
|
PORTVERSION= 3.0.6
|
||||||
PORTREVISION= 7
|
PORTREVISION= 8
|
||||||
CATEGORIES= textproc
|
CATEGORIES= textproc
|
||||||
MASTER_SITES= SF/stardict-4/${PORTVERSION}
|
MASTER_SITES= SF/stardict-4/${PORTVERSION}
|
||||||
DIST_SUBDIR= stardict
|
DIST_SUBDIR= stardict
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--- ./dict/src/lib/stddict.cpp.orig 2012-02-17 08:58:47.000000000 +0000
|
--- dict/src/lib/stddict.cpp.orig 2014-06-23 01:27:19 UTC
|
||||||
+++ ./dict/src/lib/stddict.cpp 2013-10-09 16:16:36.938640507 +0000
|
+++ dict/src/lib/stddict.cpp
|
||||||
@@ -32,6 +32,7 @@
|
@@ -32,6 +32,7 @@
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
@ -7,4 +7,38 @@
|
||||||
+#include <stdlib.h>
|
+#include <stdlib.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
@@ -2532,12 +2533,12 @@ bool Libs::LookupSynonymSimilarWord(const gchar* sWord
|
||||||
|
}
|
||||||
|
// Upper the first character and lower others.
|
||||||
|
if (!bFound) {
|
||||||
|
- gchar *nextchar = g_utf8_next_char(sWord);
|
||||||
|
+ const gchar *nextchar = g_utf8_next_char(sWord);
|
||||||
|
gchar *firstchar = g_utf8_strup(sWord, nextchar - sWord);
|
||||||
|
- nextchar = g_utf8_strdown(nextchar, -1);
|
||||||
|
- casestr = g_strdup_printf("%s%s", firstchar, nextchar);
|
||||||
|
+ gchar *nextDownchar = g_utf8_strdown(nextchar, -1);
|
||||||
|
+ casestr = g_strdup_printf("%s%s", firstchar, nextDownchar);
|
||||||
|
g_free(firstchar);
|
||||||
|
- g_free(nextchar);
|
||||||
|
+ g_free(nextDownchar);
|
||||||
|
if (strcmp(casestr, sWord)) {
|
||||||
|
bLookup = oLib[iLib]->LookupSynonym(casestr, iIndex, iIndex_suggest, CollationLevel, servercollatefunc);
|
||||||
|
if(bLookup)
|
||||||
|
@@ -2642,12 +2643,12 @@ bool Libs::LookupSimilarWord(const gchar* sWord, glong
|
||||||
|
}
|
||||||
|
// Upper the first character and lower others.
|
||||||
|
if (!bFound) {
|
||||||
|
- gchar *nextchar = g_utf8_next_char(sWord);
|
||||||
|
+ const gchar *nextchar = g_utf8_next_char(sWord);
|
||||||
|
gchar *firstchar = g_utf8_strup(sWord, nextchar - sWord);
|
||||||
|
- nextchar = g_utf8_strdown(nextchar, -1);
|
||||||
|
- casestr = g_strdup_printf("%s%s", firstchar, nextchar);
|
||||||
|
+ gchar *nextDownchar = g_utf8_strdown(nextchar, -1);
|
||||||
|
+ casestr = g_strdup_printf("%s%s", firstchar, nextDownchar);
|
||||||
|
g_free(firstchar);
|
||||||
|
- g_free(nextchar);
|
||||||
|
+ g_free(nextDownchar);
|
||||||
|
if (strcmp(casestr, sWord)) {
|
||||||
|
if(LookupSimilarWordTryWord(casestr, sWord, servercollatefunc, iLib, iIndex, idx_suggest, best_match))
|
||||||
|
bFound=true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue