From 293685cd8eeaec34b0032eed392af9c0eb14397b Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Sat, 5 Oct 2002 21:13:23 +0000 Subject: [PATCH] Random fixes --- docs/notework.txt | 4 ++++ golded3/gemnus.cpp | 5 +++++ golded3/geread2.cpp | 5 ++--- goldlib/gall/gctype.h | 10 +++++----- goldlib/gcfg/gedacfg.h | 3 ++- goldlib/gcfg/gxhpt.cpp | 23 +++++++++++------------ 6 files changed, 29 insertions(+), 21 deletions(-) diff --git a/docs/notework.txt b/docs/notework.txt index 583974c..83238dc 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -12,6 +12,10 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- Fixed lastread problem after edit externutils (PGP, etc.). + +- Oops, EchoAreaDefaults was not applied to the includes. Fixed. + + Added EchoAreaDefaults support to Fidoconfig parser. + Synchronet configuration parser now will use short description diff --git a/golded3/gemnus.cpp b/golded3/gemnus.cpp index 61381ea..c2508a4 100644 --- a/golded3/gemnus.cpp +++ b/golded3/gemnus.cpp @@ -585,7 +585,12 @@ int GMenuEditfile::Run(GMsg* __msg) { default: if(finaltag >= TAG_UTILS) { + XlatName __oldxlatimport; + // Save current charset + strcpy(__oldxlatimport, AA->Xlatimport()); + AA->SetXlatimport(CFG->xlatlocalset); ExternUtil(__msg, EDIT->SaveUtil.Number(finaltag-TAG_UTILS)); + AA->SetXlatimport(__oldxlatimport); BodyView->Use(AA, __msg, _topline); BodyView->Paint(); } diff --git a/golded3/geread2.cpp b/golded3/geread2.cpp index 973b551..5a74519 100644 --- a/golded3/geread2.cpp +++ b/golded3/geread2.cpp @@ -613,7 +613,6 @@ int ExternUtil(GMsg *msg, ExtUtil *extutil) { if(tmpfile[0] != NUL) WipeFile(tmpfile, 0); - reader_keyok = true; return YES; } @@ -665,11 +664,11 @@ void ExternUtilMenu(GMsg* msg) { extutil.utilno = 0; strxcpy(extutil.cmdline, cmdline, sizeof(extutil.cmdline)); extutil.options = CFG->externoptions; - ExternUtil(msg, &extutil); + reader_keyok = ExternUtil(msg, &extutil); } } else { - ExternUtil(msg, &CFG->externutil[n-1]); + reader_keyok = ExternUtil(msg, &CFG->externutil[n-1]); } } for(n=CFG->externutil.size()+1; n; n--) diff --git a/goldlib/gall/gctype.h b/goldlib/gall/gctype.h index ba9e9ad..8f2331f 100644 --- a/goldlib/gall/gctype.h +++ b/goldlib/gall/gctype.h @@ -45,7 +45,6 @@ #include #define tolower(c) _nls_tolower((unsigned char)(c)) #define toupper(c) _nls_toupper((unsigned char)(c)) -#endif #elif defined(__WIN32__) #ifdef __cplusplus extern "C" { @@ -55,19 +54,20 @@ __inline__ int toupper(int c) { return tu[c]; } } #else extern char tl[256], tu[256]; -#define tolower(c) tl[(int)(unsigned char)c] -#define toupper(c) tu[(int)(unsigned char)c] +#define tolower(c) tl[(int)(unsigned char)(c)] +#define toupper(c) tu[(int)(unsigned char)(c)] #endif #endif // ------------------------------------------------------------------ +// NLS chars detected by converting to lower or upper case and in case they don't match they treated as characters + #ifdef __cplusplus extern "C" { #endif -// NLS chars detected by converting to lower or upper case and in case they don't match they treated as characters -__inline__ int isxalnum(char c) { return isascii(c) ? isalnum(c) : (c != tolower(c)) || (c != toupper(c)); } +extern __inline__ int isxalnum(char c) { return isascii(c) ? isalnum(c) : (c != tolower(c)) || (c != toupper(c)); } #ifdef __cplusplus } #endif diff --git a/goldlib/gcfg/gedacfg.h b/goldlib/gcfg/gedacfg.h index debd9e8..b4d167a 100644 --- a/goldlib/gcfg/gedacfg.h +++ b/goldlib/gcfg/gedacfg.h @@ -267,8 +267,9 @@ protected: void ReadFMail116(FILE* fp, char* path, char* file, char* options); #endif #ifndef GCFG_NOFIDOCONF + AreaCfg echoareadefaults; bool ReadHPTLine(FILE* f, std::string* s, bool add=false, int state=0); - void ReadHPTFile(char* path, char* file, char* options, char* origin, int group); + void ReadHPTFile(char* path, char* file, char* origin, int group); #endif #ifndef GCFG_NOIMAIL void ReadIMail160(char* options, char* file, char* impath); diff --git a/goldlib/gcfg/gxhpt.cpp b/goldlib/gcfg/gxhpt.cpp index a20b1f3..8f07b76 100644 --- a/goldlib/gcfg/gxhpt.cpp +++ b/goldlib/gcfg/gxhpt.cpp @@ -155,7 +155,7 @@ void gareafile::gettok(char** key, char** val) { // ------------------------------------------------------------------ -void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin, int group) { +void gareafile::ReadHPTFile(char* path, char* file, char* origin, int group) { const word CRC_ADDRESS = 0xFDD6; const word CRC_INCLUDE = 0x379B; @@ -170,7 +170,7 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin, const word CRC_COMMENTCHAR = 0xE2CC; const word CRC_ECHOAREADEFAULTS = 0x2CBB; - AreaCfg aa, ad; + AreaCfg aa; Path buf2; FILE* fp = fsopen(file, "rb", sharemode); @@ -181,7 +181,6 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin, std::cout << "* Reading " << file << std::endl; aa.reset(); - ad.reset(); std::string s; while(ReadHPTLine(fp, &s)) { @@ -191,10 +190,6 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin, char *alptr = throw_xstrdup(s.c_str()); char *ptr = alptr; - aa.type = GMB_NONE; - aa.msgbase = fidomsgtype; - aa.groupid = group; - char* key; char* val = ptr; gettok(&key, &val); @@ -221,7 +216,7 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin, if(strchg(buf2, '[', '%') != 0) strchg(buf2, ']', '%'); MakePathname(buf2, path, buf2); - ReadHPTFile(path, buf2, options, origin, group); + ReadHPTFile(path, buf2, origin, group); break; case CRC_COMMENTCHAR: if((strlen(val) == 3) and (val[0] == val[2]) and strpbrk(val, "\'\"")) @@ -239,11 +234,11 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin, aa.type = GMB_LOCAL; break; case CRC_ECHOAREA: - aa = ad; + aa = echoareadefaults; aa.type = GMB_ECHO; break; case CRC_ECHOAREADEFAULTS: - ad.reset(); + echoareadefaults.reset(); aa.type = GMB_DEFAULT; break; } @@ -346,7 +341,7 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin, AddNewArea(aa); break; case GMB_DEFAULT: - ad = aa; + echoareadefaults = aa; break; default: break; @@ -404,7 +399,11 @@ void gareafile::ReadHPT(char* tag) { CfgJAMSMAPIHighwater(true); - ReadHPTFile(path, file, options, origin, defaultgroup); + echoareadefaults.type = GMB_NONE; + echoareadefaults.msgbase = fidomsgtype; + echoareadefaults.groupid = defaultgroup; + + ReadHPTFile(path, file, origin, defaultgroup); }