so we do not have to restart after

rebuilding the unifiedDict-* files.
This commit is contained in:
mwells 2014-04-10 22:01:43 -07:00
parent 503cc2e34f
commit 5988147e72

@ -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");