so we do not have to restart after
rebuilding the unifiedDict-* files.
This commit is contained in:
parent
503cc2e34f
commit
5988147e72
15
Speller.cpp
15
Speller.cpp
@ -998,8 +998,13 @@ char *Speller::getRandomWord() {
|
||||
// dict into memory using Language.loadWordList(), loadTitleRecDict(), etc
|
||||
bool Speller::loadUnifiedDict() {
|
||||
|
||||
bool building = false;
|
||||
|
||||
reload:
|
||||
|
||||
bool needRebuild = false;
|
||||
|
||||
m_unifiedBuf.purge();
|
||||
m_unifiedBuf.setLabel("unibuf");
|
||||
|
||||
// this MUST be there
|
||||
@ -1046,6 +1051,13 @@ bool Speller::loadUnifiedDict() {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( building ) {
|
||||
log("gb: rebuild failed. exiting.");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
building = true;
|
||||
|
||||
log("gb: REBUILDING unifiedDict-buf.txt and unifiedDict-map.dat");
|
||||
|
||||
// just in case that was there and the buf wasn't
|
||||
@ -1385,6 +1397,9 @@ bool Speller::loadUnifiedDict() {
|
||||
if ( m_unifiedDict.save(g_hostdb.m_dir,"unifiedDict-map.dat")<=0 )
|
||||
return false;
|
||||
|
||||
// start over and load what we created
|
||||
goto reload;
|
||||
|
||||
// hmmm... seems like we need to re-run for some reason
|
||||
log("spell: PLEASE RERUN gb");
|
||||
log("spell: PLEASE RERUN gb");
|
||||
|
Loading…
x
Reference in New Issue
Block a user