From 0d12457466e5f98cf759244d381e8849e522087f Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Fri, 10 May 2002 05:06:56 +0000 Subject: [PATCH] various fixes --- docs/building.txt | 4 ++++ docs/notework.txt | 11 ++++++++++ golded3/gealst.cpp | 2 +- golded3/gedoit.cpp | 3 +++ golded3/geline.cpp | 49 +++++++++++++++++++++++---------------------- golded3/gepost.cpp | 2 +- golded3/geread2.cpp | 10 ++++++++- 7 files changed, 54 insertions(+), 27 deletions(-) diff --git a/docs/building.txt b/docs/building.txt index 46c08e9..ac455be 100644 --- a/docs/building.txt +++ b/docs/building.txt @@ -14,6 +14,10 @@ To compile GoldED+ and utilities you'll need: --- MINGW ONLY --- Please consult this howto on installing MinGW over Cygwin: http://www.xraylith.wisc.edu/~khan/software/gnu-win32/mno-cygwin-howto.txt +--- gcc-2.95.3-5.tar.bz2 + mingw-runtime-1.3-2.tar.bz2 --- +Move /usr/include/mingw to /usr/local/include/mingw, take gcc-2.95.3-xxx.tar.gz +from www.mingw.org, copy .../lib/stdlibc++.a to /usr/local/lib/mingw, copy +.../include/g++-3 to /usr/local/include/mingw/g++-3. ------ COMMON ------ First, edit GNUmakef.def for the preferrable compilation options. diff --git a/docs/notework.txt b/docs/notework.txt index 71f3e80..c82588f 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -12,6 +12,17 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- Fixed reverse order sorting in 'M' criteria of AREALISTSORT (broken + in previous snapshots). + +- Fixed bug with quoting if text goes right after long kludge. + +- Fixed invalid message encoding after calling externutil. There's + still a bug left if you call externutil when kludges are shown and + -Reload option is specifyed to externutil. + +- Fixed replying on gated message to internet area. + - Fixed crash on long names in TwitName. - Fixed net/echomail.bss updating in Hudson/GoldBase. diff --git a/golded3/gealst.cpp b/golded3/gealst.cpp index 2f8ed02..4a66333 100644 --- a/golded3/gealst.cpp +++ b/golded3/gealst.cpp @@ -166,7 +166,7 @@ extern "C" int AreaListCmp(const Area** __a, const Area** __b) { if(A->ismarked()) return sepfirst?1:-1; } - else if((cmp = compare_two(A->ismarked(), B->ismarked())) != 0) + else if((cmp = compare_two(B->ismarked(), A->ismarked())) != 0) return cmp; break; case 'P': diff --git a/golded3/gedoit.cpp b/golded3/gedoit.cpp index 45715c9..9f92638 100644 --- a/golded3/gedoit.cpp +++ b/golded3/gedoit.cpp @@ -58,6 +58,7 @@ void SaveLines(int mode, const char* savefile, GMsg* msg, int margin, bool clip) } int lines=0; if(prnfp) { + char *old_msg_txt = throw_strdup(msg->txt); #ifdef OLD_STYLE_HEADER if(mode == MODE_WRITE) { if(prnheader) { @@ -134,6 +135,8 @@ void SaveLines(int mode, const char* savefile, GMsg* msg, int margin, bool clip) fclose(prnfp); prnfp = NULL; } + throw_release(msg->txt); + msg->txt = old_msg_txt; } else { char buf[256]; diff --git a/golded3/geline.cpp b/golded3/geline.cpp index 80235bc..700d768 100644 --- a/golded3/geline.cpp +++ b/golded3/geline.cpp @@ -1525,10 +1525,10 @@ void ScanKludges(GMsg* msg, int getvalue) { } // Check if it's a tearline - else if(not (gottear or gottag) and strneql("---", ptr, 3) and (ptr[3] == ' ' or ptr[3] == NUL)) { + else if(not (gottear or gottag) and strneql("---", ptr, 3) and (ptr[3] == ' ' or ptr[3] == NUL)) { - Line* nnel = next_non_empty(line->next); - if(not lineno or ((lineno-1) == originlineno) or not nnel or nnel->type & GLINE_KLUDGE) { + Line* nnel = next_non_empty(line->next); + if(not lineno or ((lineno-1) == originlineno) or not nnel or nnel->type & GLINE_KLUDGE) { // Found Tearline gottear = YES; tearlineno = lineno; @@ -1536,7 +1536,7 @@ void ScanKludges(GMsg* msg, int getvalue) { line->color = C_READT; strbtrim(strcpy(msg->tearline, ptr+3)); - if(getvalue and CFG->gedhandshake) { + if(getvalue and CFG->gedhandshake) { char* tearid[] = { "GoldED", " GED ", @@ -1562,18 +1562,18 @@ void ScanKludges(GMsg* msg, int getvalue) { } } } - } + } // Check if it's an originline else if(not (gotorig or gottear or gottag) and strneql(" * Origin: ", ptr, 11)) { // Found Origin line bool cnd = line->next != NULL; - Line* nnel = next_non_empty(line->next); - bool nextkl = cnd ? not nnel or nnel->type & GLINE_KLUDGE : false; - nnel = cnd ? next_non_empty(line->next->next) : NULL; - bool nextor = cnd ? (not nnel or nnel->type & GLINE_KLUDGE) and (line->next->txt.find(/*(*/')') != line->next->txt.npos) : false; - if(not line->next or nextkl or nextor) { + Line* nnel = next_non_empty(line->next); + bool nextkl = cnd ? not nnel or nnel->type & GLINE_KLUDGE : false; + nnel = cnd ? next_non_empty(line->next->next) : NULL; + bool nextor = cnd ? (not nnel or nnel->type & GLINE_KLUDGE) and (line->next->txt.find(/*(*/')') != line->next->txt.npos) : false; + if(not line->next or nextkl or nextor) { gotorig = YES; originlineno = lineno; @@ -1857,13 +1857,18 @@ static bool check_multipart(const char* ptr, char* boundary) { inline bool put_on_new_line(const char *ptr, const char *prev_ptr) { - if(((ptr[0] == ptr[1]) and (ptr[0] == ptr[2])) or - strneql(ptr, " * Origin: ", 11) or - strneql(ptr, "SEEN-BY:", 8) or - strneql(ptr, "Reply-To:", 9) or - strneql(ptr, "To:", 3) or - strneql(ptr, "From:", 5) or - (ptr[0] == prev_ptr[0]) and (ptr[1] == prev_ptr[1])) + if((*ptr == CR) or + (*ptr == CTRL_A) or + is_quote(ptr) or + ((ptr[0] == ptr[1]) and (ptr[0] == ptr[2])) or + (strneql(ptr, "-- ", 3) and (ptr[3] == CR)) or + strneql(ptr, " * Origin: ", 11) /*or + (ptr[0] == prev_ptr[0]) and (ptr[1] == prev_ptr[1])*/) + return true; + // Put RFC kludges and SEEN-BY on new line + while(*ptr and (isxalnum(*ptr) or (*ptr == '-'))) + ptr++; + if(*ptr == ':') return true; return false; } @@ -1880,7 +1885,6 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) { char ch, chln = 0, dochar; Line* line; Line* nextline=NULL; - Line* prevline=NULL; char* bp; char* btmp=NULL; char* tptr; @@ -2030,6 +2034,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) { para = 0; if(*ptr == CTRL_A or inheader) { // Found kludge/hidden line + para = GLINE_KLUD; line->type |= GLINE_HARD; if(getvalue and not CFG->ignorecharset) { tptr = ptr; @@ -2204,11 +2209,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) { if(wraps and not ((line->type & GLINE_HARD) and not (line->type & GLINE_QUOT))) { if(para != GLINE_QUOT) { if(quoteflag) { - if(prevline and (*prevline->txt.c_str() == CTRL_A) and (prevline->type & GLINE_WRAP)) { - wraps = 0; - break; - } - if((*ptr == CR) or is_quote(ptr) or (*ptr == CTRL_A)) { + if(para == GLINE_KLUD) { wraps = 0; break; } @@ -2502,7 +2503,7 @@ void MakeLineIndex(GMsg* msg, int margin, bool getvalue, bool header_recode) { else line->color = C_READW; - prevline = line; + Line* prevline = line; line = new Line(); throw_xnew(line); line->prev = prevline; diff --git a/golded3/gepost.cpp b/golded3/gepost.cpp index 20875af..3bf3712 100644 --- a/golded3/gepost.cpp +++ b/golded3/gepost.cpp @@ -882,7 +882,7 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) { strcpy(msg->to, omsg->By()); strcpy(msg->realto, omsg->realby); msg->dest = omsg->orig; - strcpy(msg->idest, *omsg->ireplyto ? omsg->ireplyto : omsg->iorig); + strcpy(msg->idest, *omsg->ireplyto ? omsg->ireplyto : *omsg->iorig ? omsg->iorig : omsg->iaddr); } if(not *msg->iaddr) strcpy(msg->iaddr, msg->idest); diff --git a/golded3/geread2.cpp b/golded3/geread2.cpp index 033d721..949e6e8 100644 --- a/golded3/geread2.cpp +++ b/golded3/geread2.cpp @@ -579,8 +579,16 @@ int ExternUtil(GMsg *msg, ExtUtil *extutil) { int hardlines = EDIT->HardLines(); EDIT->HardLines(false); LoadText(msg, editorfile); - EDIT->HardLines(hardlines); + + // Prepend "@CHRS: XLATLOCALSET 2\n" to force proper encoding + if(not AA->Viewkludge()) { + char *msg_txt_chrs = (char *)throw_malloc(strlen(msg->txt)+strlen(CFG->xlatlocalset)+sizeof("\001CHRS: 2\r")+16); + sprintf(msg_txt_chrs, "\001CHRS: %s 2\r%s", CFG->xlatlocalset, msg->txt); + throw_free(msg->txt); + msg->txt = msg_txt_chrs; + } + // Ignore any kludge address found msg->TextToLines(CFG->dispmargin-(int)CFG->switches.get(disppagebar), false); }