diff --git a/docs/notework.txt b/docs/notework.txt index 8ceb387..9866604 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,8 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- Prevent crash of golded while formatting status line. + - Added "news:" and "ed2k://" to the list of known URLs beginning. + New reader key READGotoThNextUnread (default: @Down) added, that will diff --git a/golded3/gearea.cpp b/golded3/gearea.cpp index 870bf9c..3d20621 100644 --- a/golded3/gearea.cpp +++ b/golded3/gearea.cpp @@ -116,7 +116,7 @@ void GPickArealist::do_delayed() { char buf[256], tmp[200]; strcpy(tmp, area->echoid()); - update_statuslinef("%s: %u %s, %u %s, %u %s", tmp, area->Msgn.Count(), (area->Msgn.Count() == 1 ? LNG->msg : LNG->msgs), area->unread, LNG->unread, area->PMrk.Count(), LNG->personal); + update_statuslinef("%s: %u %s, %u %s, %u %s", "", tmp, area->Msgn.Count(), (area->Msgn.Count() == 1 ? LNG->msg : LNG->msgs), area->unread, LNG->unread, area->PMrk.Count(), LNG->personal); strcpy(stpcpy(buf, title), area_maybe); strsetsz(strcpy(tmp, buf), MAXCOL); @@ -464,7 +464,7 @@ void GPickArealist::AreaCatchUp(uint n) { if((*AL.item)->isseparator()) continue; - update_statuslinef("%s ...", (*AL.item)->echoid()); + update_statuslinef("%s ...", "", (*AL.item)->echoid()); AA = (*AL.item); AA->Open(); @@ -651,7 +651,7 @@ bool GPickArealist::handle_key() { if(mode != SCAN_QUIT) { for(AL.item = AL.idx.begin(); AL.item != AL.idx.end(); AL.item++) { if((mode == SCAN_MARKED and (*AL.item)->ismarked()) or mode == SCAN_ALL or (mode == SCAN_CURRENT and (*AL.item) == AL[index-1])) { - update_statuslinef("%s %s", 1+LNG->ScanningArea, (*AL.item)->echoid()); + update_statuslinef("%s %s", "", 1+LNG->ScanningArea, (*AL.item)->echoid()); (*AL.item)->SetHighwaterMark(); } } @@ -666,7 +666,7 @@ bool GPickArealist::handle_key() { if(mode != SCAN_QUIT) { for(AL.item = AL.idx.begin(); AL.item != AL.idx.end(); AL.item++) { if((mode == SCAN_MARKED and (*AL.item)->ismarked()) or mode == SCAN_ALL or (mode == SCAN_CURRENT and (*AL.item) == AL[index-1])) { - update_statuslinef("%s %s", 1+LNG->ScanningArea, (*AL.item)->echoid()); + update_statuslinef("%s %s", "", 1+LNG->ScanningArea, (*AL.item)->echoid()); (*AL.item)->ResetHighwaterMark(); } } diff --git a/golded3/gecmfd.cpp b/golded3/gecmfd.cpp index 5fd7ba8..200da7f 100644 --- a/golded3/gecmfd.cpp +++ b/golded3/gecmfd.cpp @@ -183,7 +183,7 @@ void Area::DelMsgs(GMsg* msg) { break; } } - update_statuslinef(LNG->DeletingMsg, x+1, Mark.Count()); + update_statuslinef(LNG->DeletingMsg, "ST_DELETINGMSG", x+1, Mark.Count()); w_progress(MODE_UPDATE, C_INFOW, x+1, Mark.Count(), LNG->Deleting); uint msgno = Mark[x]; if(Msgn.ToReln(msgno)) { @@ -303,6 +303,7 @@ void CmfMsgs(GMsg* msg, bool torecycle) char* markstr = NULL; char* progstr = NULL; char* statstr = NULL; + char* tokenstr = ""; int loadmode = GMSG_UNS_NOT_RCV; switch(cmf) { case MODE_COPY: @@ -311,6 +312,7 @@ void CmfMsgs(GMsg* msg, bool torecycle) markstr = LNG->Copy; progstr = LNG->Copying; statstr = LNG->CopyingMsg; + tokenstr = "ST_COPYINGMSG"; loadmode |= GMSG_COPY; break; case MODE_MOVE: @@ -335,6 +337,7 @@ void CmfMsgs(GMsg* msg, bool torecycle) markstr = LNG->Move; progstr = LNG->Moving; statstr = LNG->MovingMsg; + tokenstr = "ST_MOVINGMSG"; } loadmode |= GMSG_MOVE; @@ -498,7 +501,7 @@ void CmfMsgs(GMsg* msg, bool torecycle) // Show progress and load the marked msg if(do_mode == MODE_MARKED) { - update_statuslinef(statstr, mrk+1, mrks, echoid); + update_statuslinef(statstr, tokenstr, mrk+1, mrks, echoid); loadmsgno = *mrkp++; } diff --git a/golded3/gedoit.cpp b/golded3/gedoit.cpp index 9d80522..46367d8 100644 --- a/golded3/gedoit.cpp +++ b/golded3/gedoit.cpp @@ -227,7 +227,7 @@ static void WriteMsgs(GMsg* msg) { break; } } - update_statuslinef(LNG->WritingMsg, n+1, AA->Mark.Count()); + update_statuslinef(LNG->WritingMsg, "ST_WRITINGMSG", n+1, AA->Mark.Count()); w_progress(MODE_UPDATE, C_INFOW, n+1, AA->Mark.Count(), LNG->Writing); AA->LoadMsg(msg, AA->Mark[n], prnmargin); if(target & WRITE_PRINTER) { diff --git a/golded3/geedit.cpp b/golded3/geedit.cpp index b728009..e2aa5d6 100644 --- a/golded3/geedit.cpp +++ b/golded3/geedit.cpp @@ -2629,7 +2629,7 @@ void IEclass::statusline() { } uint chr = currline->txt[col]; - update_statuslinef(LNG->EditStatus, 1+thisrow, 1+col, chr, _buf); + update_statuslinef(LNG->EditStatus, "ST_EDITSTATUS", 1+thisrow, 1+col, chr, _buf); if(*_buf and CFG->switches.get(beepcomment)) { HandleGEvent(EVTT_EDITCOMMENT); } diff --git a/golded3/geedit2.cpp b/golded3/geedit2.cpp index 36f02c1..c419cf0 100644 --- a/golded3/geedit2.cpp +++ b/golded3/geedit2.cpp @@ -973,7 +973,7 @@ void IEclass::editimport(Line* __line, char* __filename, bool imptxt) { // Set selection window title and statusline set_title(LNG->ImportTitle, TCENTER, C_MENUT); - update_statuslinef(LNG->ImportStatus, filenamebuf.c_str()); + update_statuslinef(LNG->ImportStatus, "ST_IMPORTSTATUS", filenamebuf.c_str()); // Start the file picker fileselected = wpickfile(win_minrow, win_mincol, win_maxrow, win_maxcol, W_BMENU, C_MENUB, C_MENUW, C_MENUS, NO, filenamebuf, maketitle_and_status); @@ -1005,7 +1005,7 @@ void IEclass::editimport(Line* __line, char* __filename, bool imptxt) { imp_filename = (getclip or isPipe) ? filenamebuf.c_str() : CleanFilename(filenamebuf.c_str()); } - update_statuslinef(LNG->ImportStatus, filenamebuf.c_str()); + update_statuslinef(LNG->ImportStatus, "ST_IMPORTSTATUS", filenamebuf.c_str()); // Allocate paragraph read buffer char* _parabuf = (char*)throw_malloc(EDIT_PARABUFLEN); @@ -1291,7 +1291,7 @@ void IEclass::editexport(Line* __exportline, int __endat) { FILE* _fp = fsopen(_filenameptr, (*Edit__exportfilename == '+') ? "at" : "wt", CFG->sharemode); if(_fp) { - update_statuslinef(LNG->ExportStatus, Edit__exportfilename); + update_statuslinef(LNG->ExportStatus, "ST_EXPORTSTATUS", Edit__exportfilename); fputc('\n', _fp); while((__endat ? __exportline != currline : 1) and __exportline) { diff --git a/golded3/gefile.cpp b/golded3/gefile.cpp index 25fcfc5..754c2dd 100644 --- a/golded3/gefile.cpp +++ b/golded3/gefile.cpp @@ -534,18 +534,22 @@ void CreateFileMsgs(int mode, GMsg* msg) { char* LNG_File = NULL; char* LNG_Fileing = NULL; + char* tokenstr = ""; if(msg->attr.att()) { LNG_File = LNG->File_Attach; LNG_Fileing = LNG->FileAttaching; + tokenstr = "ST_FILEATTACHING"; } else if(msg->attr.frq()) { LNG_File = LNG->File_Request; LNG_Fileing = LNG->FileRequesting; + tokenstr = "ST_FILEREQUESTING"; } else if(msg->attr.urq()) { LNG_File = LNG->File_Updreq; LNG_Fileing = LNG->FileUpdreqing; + tokenstr = "ST_FILEUPDREQING"; } *buf = NUL; @@ -574,7 +578,7 @@ void CreateFileMsgs(int mode, GMsg* msg) { for(m=0; m 1) { w_progress(MODE_UPDATE, C_INFOW, n+1, specfiles, LNG_File); - update_statuslinef(LNG_Fileing, n+1, specfiles, + update_statuslinef(LNG_Fileing, tokenstr, n+1, specfiles, msg->dest.zone, msg->dest.net, msg->dest.node, msg->dest.point ); } diff --git a/golded3/gefind.cpp b/golded3/gefind.cpp index 81698e7..5c9b543 100644 --- a/golded3/gefind.cpp +++ b/golded3/gefind.cpp @@ -113,7 +113,7 @@ bool FindString(GMsg* msg, const char* prompt, int what) { do { - update_statuslinef(LNG->ReadingMsg, AA->lastread(), AA->Msgn.Count()); + update_statuslinef(LNG->ReadingMsg, "ST_READINGMSG", AA->lastread(), AA->Msgn.Count()); w_progress(MODE_UPDATE, C_INFOW, AA->lastread(), AA->Msgn.Count(), LNG->AdvancedSearch); bool success = false; diff --git a/golded3/geinit.cpp b/golded3/geinit.cpp index a237d6a..92ae02f 100644 --- a/golded3/geinit.cpp +++ b/golded3/geinit.cpp @@ -1031,7 +1031,7 @@ void Initialize(int argc, char* argv[]) { update_statuslines(); // Initialize the messagebases - update_statuslinef(LNG->LockShareCap, LNG->Checking); + update_statuslinef(LNG->LockShareCap, "ST_LOCKSHARECAP", LNG->Checking); WideLog = &LOG; WideDebug = cmdlinedebughg; WideCanLock = CFG->sharemode ? TestLockPath(CFG->temppath) : false; @@ -1049,64 +1049,64 @@ void Initialize(int argc, char* argv[]) { LoadLanguage(CFG->loadlanguage); if(find(AL.basetypes, "OPUS") or find(AL.basetypes, "FTS1")) { - update_statuslinef("%s Fido", LNG->Checking); + update_statuslinef("%s Fido", "", LNG->Checking); FidoInit(CFG->fidolastread, CFG->switches.get(fidohwmarks), CFG->switches.get(fidonullfix), CFG->fidouserno, CFG->squishuserpath); } #ifndef GMB_NOEZY if(find(AL.basetypes, "EZYCOM")) { - update_statuslinef("%s Ezycom", LNG->Checking); + update_statuslinef("%s Ezycom", "", LNG->Checking); EzycomInit(CFG->ezycom.msgbasepath, CFG->ezycom.userbasepath, CFG->ezycomuserno); } #endif #ifndef GMB_NOGOLD if(find(AL.basetypes, "GOLDBASE")) { - update_statuslinef("%s Goldbase", LNG->Checking); + update_statuslinef("%s Goldbase", "", LNG->Checking); GoldInit(CFG->goldbasepath, CFG->goldbasesyspath, CFG->goldbaseuserno); } #endif #ifndef GMB_NOHUDS if(find(AL.basetypes, "HUDSON")) { - update_statuslinef("%s Hudson", LNG->Checking); + update_statuslinef("%s Hudson", "", LNG->Checking); HudsInit(CFG->hudsonpath, CFG->hudsonsyspath, CFG->hudsonuserno, CFG->hudsonsizewarn, CFG->ra2usersbbs); } #endif #ifndef GMB_NOJAM if(find(AL.basetypes, "JAM")) { - update_statuslinef("%s JAM", LNG->Checking); + update_statuslinef("%s JAM", "", LNG->Checking); JamInit(CFG->jampath, CFG->switches.get(jamharddelete), CFG->switches.get(jamsmapihw)); } #endif #ifndef GMB_NOPCB if(find(AL.basetypes, "PCBOARD")) { - update_statuslinef("%s PCBoard", LNG->Checking); + update_statuslinef("%s PCBoard", "", LNG->Checking); PcbInit(CFG->pcboardpath, CFG->pcboarduserno); } #endif #ifndef GMB_NOSQSH if(find(AL.basetypes, "SQUISH")) { - update_statuslinef("%s Squish", LNG->Checking); + update_statuslinef("%s Squish", "", LNG->Checking); SquishInit(CFG->squishuserpath, CFG->squishuserno, CFG->switches.get(squishdirect), true, CFG->squishscan); } #endif #ifndef GMB_NOWCAT if(find(AL.basetypes, "WILDCAT")) { - update_statuslinef("%s WildCat!", LNG->Checking); + update_statuslinef("%s WildCat!", "", LNG->Checking); WCatInit(CFG->wildcatuserno); } #endif #ifndef GMB_NOXBBS if(find(AL.basetypes, "ADEPTXBBS")) { - update_statuslinef("%s AdeptXBBS", LNG->Checking); + update_statuslinef("%s AdeptXBBS", "", LNG->Checking); XbbsInit(CFG->adeptxbbspath, CFG->adeptxbbsuserno); } #endif #ifndef GMB_NOSMB if(find(AL.basetypes, "SMB")) { - update_statuslinef("%s Synchronet", LNG->Checking); + update_statuslinef("%s Synchronet", "", LNG->Checking); SMBInit(); } #endif - update_statuslinef("..."); + update_statuslinef("...", ""); // Delete the D'Bridge "mail waiting" semaphore files if(dbedit) { diff --git a/golded3/gemlst.cpp b/golded3/gemlst.cpp index 689c990..9aaf7cc 100644 --- a/golded3/gemlst.cpp +++ b/golded3/gemlst.cpp @@ -250,7 +250,7 @@ void GMsgList::do_delayed() { if(CFG->switches.get(msglistpagebar)) wscrollbar(W_VERT, maximum_index+1, maximum_index, index); - update_statuslinef(LNG->MsgLister, index+1, maximum_index+1, maximum_index-index); + update_statuslinef(LNG->MsgLister, "ST_MSGLISTER", index+1, maximum_index+1, maximum_index-index); } @@ -803,7 +803,7 @@ void GThreadlist::do_delayed() { if(CFG->switches.get(msglistpagebar)) wscrollbar(W_VERT, maximum_index+1, maximum_index, index); - update_statuslinef(LNG->MsgLister, index+1, maximum_index+1, maximum_index-index); + update_statuslinef(LNG->MsgLister, "ST_MSGLISTER", index+1, maximum_index+1, maximum_index-index); } diff --git a/golded3/gemnus.cpp b/golded3/gemnus.cpp index 193ad8d..9158bfc 100644 --- a/golded3/gemnus.cpp +++ b/golded3/gemnus.cpp @@ -303,7 +303,7 @@ int GMenuDomarks::Run(char* dowhat) { else if(CFG->menumarked == MODE_DONT) _prevtag = AA->Mark.Count() ? TAG_MARKED : TAG_CURRENT; - update_statuslinef("%i %s %s", AA->Mark.Count(), AA->Mark.Count() == 1 ? LNG->is : LNG->are, LNG->marked); + update_statuslinef("%i %s %s", "", AA->Mark.Count(), AA->Mark.Count() == 1 ? LNG->is : LNG->are, LNG->marked); AskInit(6, 0, dowhat, H_AskDoMarks); @@ -481,7 +481,7 @@ int GMenuEditfile::Run(GMsg* __msg) { for(;;) { - update_statuslinef(LNG->Quotepct, __msg->quotepct, __msg->quotepct > 80 ? "!!!" : ""); + update_statuslinef(LNG->Quotepct, "ST_QUOTEPCT", __msg->quotepct, __msg->quotepct > 80 ? "!!!" : ""); char _title[80]; sprintf(_title, LNG->SaveMsg, __msg->lines); diff --git a/golded3/gemrks.cpp b/golded3/gemrks.cpp index 75e58fe..0ac86aa 100644 --- a/golded3/gemrks.cpp +++ b/golded3/gemrks.cpp @@ -195,7 +195,7 @@ void MarkMsgs_Txt(int item, char* markstring) { } } - update_statuslinef(LNG->SearchingMsg, n, AA->Msgn.Count(), marked); + update_statuslinef(LNG->SearchingMsg, "ST_SEARCHINGMSG", n, AA->Msgn.Count(), marked); w_progress(MODE_UPDATE, C_INFOW, n, AA->Msgn.Count(), NULL); if(AA->LoadMsg(msg, AA->Msgn[n-1], CFG->dispmargin-(int)CFG->switches.get(disppagebar))) { @@ -204,7 +204,7 @@ void MarkMsgs_Txt(int item, char* markstring) { if(srchmgr.reverse ? not success : success) { AA->Mark.Add(msg->msgno); - update_statuslinef(LNG->SearchingMsg, n, AA->Msgn.Count(), ++marked); + update_statuslinef(LNG->SearchingMsg, "ST_SEARCHINGMSG", n, AA->Msgn.Count(), ++marked); } } } diff --git a/golded3/gepost.cpp b/golded3/gepost.cpp index bc224a0..a9d0384 100644 --- a/golded3/gepost.cpp +++ b/golded3/gepost.cpp @@ -280,7 +280,7 @@ static void MakeMsg3(int& mode, GMsg* msg) { if(cc) { std::string temp; - update_statuslinef(LNG->StatusCC, msg->to, msg->dest.make_string(temp).c_str()); + update_statuslinef(LNG->StatusCC, "ST_STATUSCC", msg->to, msg->dest.make_string(temp).c_str()); } msg->LinesToText(); @@ -369,7 +369,7 @@ static void MakeMsg3(int& mode, GMsg* msg) { AA->NewMsgno(cmsg); { std::string temp; - update_statuslinef(LNG->StatusCC, cmsg->to, cmsg->dest.make_string(temp).c_str()); + update_statuslinef(LNG->StatusCC, "ST_STATUSCC", cmsg->to, cmsg->dest.make_string(temp).c_str()); } // Do aka matching @@ -1227,7 +1227,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) { throw_release(fspec); if(crosspost and post_xparea.size()) - update_statuslinef(LNG->Crossposting, AL[post_xparea.back()]->echoid()); + update_statuslinef(LNG->Crossposting, "ST_CROSSPOSTING", AL[post_xparea.back()]->echoid()); } while(post_xparea.size()); _in_editor = NO; diff --git a/golded3/geprot.h b/golded3/geprot.h index 9d18d92..0f10fb2 100644 --- a/golded3/geprot.h +++ b/golded3/geprot.h @@ -408,7 +408,7 @@ int SearchTaglist(Echo* taglist, char* tag); void set_title(const char* t, int p, int a); void title_shadow(); void update_statusline(const char* info); -void update_statuslinef(const char* format, ...) __attribute__ ((format (printf, 1, 2))); +void update_statuslinef(const char* format, const char *token, ...) __attribute__ ((format (printf, 1, 3))); void update_statuslines(); void w_info(const char* info=NULL); void w_infof(const char* format, ...) __attribute__ ((format (printf, 1, 2))); diff --git a/golded3/geqwks.cpp b/golded3/geqwks.cpp index a1c95b4..86eaac1 100644 --- a/golded3/geqwks.cpp +++ b/golded3/geqwks.cpp @@ -231,7 +231,7 @@ int ImportQWK() { imported++; AA->istossed = true; - update_statuslinef("%s: %u", AA->echoid(), imported); + update_statuslinef("%s: %u", "", AA->echoid(), imported); msg->TextToLines(CFG->dispmargin-1); if(msg->messageid or msg->references or msg->inreplyto or *msg->ifrom) { @@ -498,7 +498,7 @@ int ExportQwkArea(int areano, gfile& fp, int confno, int& pktmsgno) { if(AA->LoadMsg(msg, AA->Expo[n], 80)) { if(msg->attr.uns()) { exported += ExportQwkMsg(msg, fp, confno, pktmsgno); - update_statuslinef("%s: %u", AA->echoid(), exported); + update_statuslinef("%s: %u", "", AA->echoid(), exported); } } } diff --git a/golded3/geread2.cpp b/golded3/geread2.cpp index 2b341ad..bac3855 100644 --- a/golded3/geread2.cpp +++ b/golded3/geread2.cpp @@ -888,7 +888,7 @@ void Make_Userlist(const char* userlist) { if(fp) { w_progress(MODE_NEW, C_INFOW, 0, AA->Msgn.Count(), LNG->GenUserlist); for(n=AA->Msgn.Count(); n; n--) { - update_statuslinef(LNG->ReadingMsg, n, AA->Msgn.Count()); + update_statuslinef(LNG->ReadingMsg, "ST_READINGMSG", n, AA->Msgn.Count()); w_progress(MODE_UPDATE, C_INFOW, (AA->Msgn.Count()-n)+1, AA->Msgn.Count(), NULL); AA->LoadMsg(msg, AA->Msgn.CvtReln(n), CFG->dispmargin); crc = strCrc16(msg->by, false); @@ -950,7 +950,7 @@ void make_pathreport(const char* reportfile) { GMsg* msg = (GMsg*)throw_calloc(1, sizeof(GMsg)); w_progress(MODE_NEW, C_INFOW, 0, AA->Msgn.Count(), "Generating PATH report"); for(int n=AA->Msgn.Count(); n>=AA->lastread(); n--) { - update_statuslinef(LNG->ReadingMsg, n, AA->Msgn.Count()); + update_statuslinef(LNG->ReadingMsg, "ST_READINGMSG", n, AA->Msgn.Count()); w_progress(MODE_UPDATE, C_INFOW, n, AA->Msgn.Count(), NULL); AA->LoadMsg(msg, AA->Msgn.CvtReln(n), CFG->dispmargin-(int)CFG->switches.get(disppagebar)); address = msg->orig; diff --git a/golded3/gescan.cpp b/golded3/gescan.cpp index 8b128c9..99f6fb1 100644 --- a/golded3/gescan.cpp +++ b/golded3/gescan.cpp @@ -243,7 +243,7 @@ int AreaList::AreaScan(int mode, uint currno, int pmscan, int& pmails, int& pmar } scanned = YES; if(not blanked) - update_statuslinef("%s %s", 1+LNG->ScanningArea, AA->echoid()); + update_statuslinef("%s %s", "", 1+LNG->ScanningArea, AA->echoid()); if(dopmscan and (not dopmscanexcl or dopmscanincl)) { AA->ScanAreaPM(); uint count = AA->PMrk.Count(); diff --git a/golded3/gesoup.cpp b/golded3/gesoup.cpp index e90a08b..c16d11c 100644 --- a/golded3/gesoup.cpp +++ b/golded3/gesoup.cpp @@ -350,7 +350,7 @@ void ProcessSoupMsg(char* lbuf, GMsg* msg, int& msgs, char* areaname, int tossto if(lineno) { AA->istossed = true; - update_statuslinef("%s: %u", AA->echoid(), msgs); + update_statuslinef("%s: %u", "", AA->echoid(), msgs); msg->LinesToText(); AA->SaveMsg(GMSG_NEW, msg); @@ -731,7 +731,7 @@ int ExportSoupArea(int areano, char* msgfile, gfile& fp, int ismail) { if(AA->LoadMsg(msg, AA->Expo[n], CFG->soupexportmargin)) { if(msg->attr.uns() and not (msg->attr.del() or msg->attr.lok())) { exported += ExportSoupMsg(msg, msgfile, fp, ismail); - update_statuslinef("%s: %u", AA->echoid(), exported); + update_statuslinef("%s: %u", "", AA->echoid(), exported); } } } diff --git a/golded3/geusrbse.cpp b/golded3/geusrbse.cpp index 4ba1405..d0c64d2 100644 --- a/golded3/geusrbse.cpp +++ b/golded3/geusrbse.cpp @@ -191,7 +191,7 @@ void guserbase::close() { void guserbase::do_delayed() { wscrollbar(W_VERT, maximum_index+1, maximum_index, index); - update_statuslinef(LNG->UserStatusline, index+1, maximum_index+1, maximum_index-index); + update_statuslinef(LNG->UserStatusline, "ST_USERSTATUSLINE", index+1, maximum_index+1, maximum_index-index); } diff --git a/golded3/geutil.cpp b/golded3/geutil.cpp index 7f9be47..3cc4929 100644 --- a/golded3/geutil.cpp +++ b/golded3/geutil.cpp @@ -132,14 +132,35 @@ void update_statusline(const char* info) { // ------------------------------------------------------------------ -void update_statuslinef(const char* format, ...) { - +void update_statuslinef(const char *format, const char *token, ...) +{ + bool error = false; char winfobuf[350]; va_list argptr; - va_start(argptr, format); - vsprintf(winfobuf, format, argptr); + va_start(argptr, token); + + try + { + vsprintf(winfobuf, format, argptr); + } + catch(...) + { + if (*token) + sprintf(winfobuf, "ERROR: Update %s in your GOLDLANG.CFG or report to author.", token); + else + sprintf(winfobuf, "ERROR: \"%s\". Report to author.", format); + + error = true; + } + va_end(argptr); update_statusline(winfobuf); + + if (error) + { + SayBibi(); + waitkeyt(1000); + } } @@ -286,7 +307,7 @@ void maketitle() { int maketitle_and_status(char *dir) { maketitle(); - update_statuslinef(LNG->ImportStatus, dir); + update_statuslinef(LNG->ImportStatus, "ST_IMPORTSTATUS", dir); return 0; } diff --git a/golded3/geutil2.cpp b/golded3/geutil2.cpp index 069badd..4e433dd 100644 --- a/golded3/geutil2.cpp +++ b/golded3/geutil2.cpp @@ -100,7 +100,7 @@ bool PopupLocked(long tries, int isopen, const char* file) { else strcpy(buf, file); w_infof(LNG->WaitLocked, buf); - update_statuslinef(LNG->RetryOrESC, isopen ? LNG->RetryLock : LNG->RetryOpen , tries); + update_statuslinef(LNG->RetryOrESC, "ST_RETRYORESC", isopen ? LNG->RetryLock : LNG->RetryOpen , tries); // Check for keypress if(kbxhit()) { diff --git a/golded3/gmarea.cpp b/golded3/gmarea.cpp index 8ed8f26..94f9a79 100644 --- a/golded3/gmarea.cpp +++ b/golded3/gmarea.cpp @@ -183,7 +183,7 @@ void RenumberArea() { TouchFile(AddPath(CFG->areapath, CFG->semaphore.netscan)); // Tell user we are finished - update_statuslinef("%u %s", AA->Msgn.Count(), LNG->Renumbered); + update_statuslinef("%u %s", "", AA->Msgn.Count(), LNG->Renumbered); waitkeyt(5000); } }