various fixes

This commit is contained in:
Alexander S. Aganichev 2001-01-27 11:52:13 +00:00
parent f5ebff9c19
commit d288f34470
18 changed files with 135 additions and 87 deletions

View File

@ -9,10 +9,20 @@ ______________________________________________________________________
______________________________________________________________________ ______________________________________________________________________
Notes for GoldED+ 1.1.5, December xx 2000 Notes for GoldED+ 1.1.5, February xx 2001
______________________________________________________________________ ______________________________________________________________________
- PGP encoded/signed messages now detected by substring ! If @pseudo token created from address it now stops not only on space
but at @ as well, so no more "Hello bigfoot@shoes.com!" :-)
! Maximum number of commands that could be assigned to single macro
extended upto 127 commands.
- ViewQuote operation fixed for locales different from ASCII.
- @cdate and @ctime now should be correct for changed messages.
! PGP encoded/signed messages now detected by substring
"-----BEGIN PGP " "-----BEGIN PGP "
@ -77,7 +87,7 @@ ______________________________________________________________________
+ Added READDirQuoteMsg and READMoveDirQuoteMsg entries for + Added READDirQuoteMsg and READMoveDirQuoteMsg entries for
goldkeys.cfg: quote message ignoring Reply-To kludge (in current and goldkeys.cfg: quote message ignoring Reply-To kludge (in current and
another area correspondingly). Both added to READMainmenu menu. another area correspondingly). Both added to READMainmenu menu.
There's no default keyboard assignment. (Not tested) There's no default keyboard assignment.
- Fixed READMainmenu operation. - Fixed READMainmenu operation.

View File

@ -22,7 +22,9 @@ assistance!
11. А почему GoldED+ так криво поддерживает hpt-шные конфиги (не под UNIXами)? 11. А почему GoldED+ так криво поддерживает hpt-шные конфиги (не под UNIXами)?
12. Почему не вводится русская "Э" под Win95? 12. Почему не вводится русская "Э" под Win95?
13. Backspace в Linux'e 13. Backspace в Linux'e
14. Типа эта... А писать куда автору? ;-) 14. А зачем мне этот <censored> редактор нужен? У Одинна было лучше!
15. А вот я хочу аналог MCITY встроенный.
16. Типа эта... А писать куда автору? ;-)
>============================================================================== >==============================================================================
@ -62,10 +64,9 @@ assistance!
*Q:* А где обещанное CUA? *Q:* А где обещанное CUA?
*A:* Чтобы использовать CUA при выключенном KEYBDEFAULTS надо его определить. *A:* Чтобы использовать CUA при выключенном KEYBDEFAULTS надо его определить.
Хотя всякие #Left не описаны в документации, они физически есть всюду, Хотя всякие #Left не описаны в документации, они есть :) В Линуксе
кроме версии для Linux (с 1.1.4.5 они есть и на линуксовой консоли). работает только на консоли, да и то не всегда (точно не работает, если
Скорее всего CUA под Linux'ом (и в планах BSD) будет работать только на запускать из-под midnight commander'а).
иксовой консоли, поскольку вывод на экран будет повраплен в ncurses.
*Q:* А что за проблемы с INVALIDATE <token> "" ""? Почему все-равно квотится? *Q:* А что за проблемы с INVALIDATE <token> "" ""? Почему все-равно квотится?
*A:* Это опять недочитанная до конца документация. Используйте ключевое слово *A:* Это опять недочитанная до конца документация. Используйте ключевое слово
@ -95,7 +96,8 @@ assistance!
*Q:* Что за левизна в адресах кросспостов, начиная с 1.1.3? *Q:* Что за левизна в адресах кросспостов, начиная с 1.1.3?
*A:* В goldlang.cfg поменялся формат для слов MS_LISTCC ("%s %s") и *A:* В goldlang.cfg поменялся формат для слов MS_LISTCC ("%s %s") и
ST_STATUSCC ("CC: %s of %s"). Проверьте свой конфиг! ST_STATUSCC ("CC: %s of %s"). Проверьте свой конфиг и поменяйте по
аналогии!
*Q:* Поставил себе hpt. И что это за лажа при чтении конфигов? *Q:* Поставил себе hpt. И что это за лажа при чтении конфигов?
*A:* А вы уверены, что вы читали доку на свой hpt? В доке явно написано, что *A:* А вы уверены, что вы читали доку на свой hpt? В доке явно написано, что
@ -113,6 +115,13 @@ assistance!
*A:* Alexey Froloff: ``keycode 14 = delete delete delete delete'' в keymap'е *A:* Alexey Froloff: ``keycode 14 = delete delete delete delete'' в keymap'е
прописать надо. прописать надо.
*Q:* А зачем мне этот <censored> редактор нужен? У Одинна было лучше!
*A:* А кто-то заставляет пользоваться? :-) Не нравится - сноси и пользуйся тем,
что нравится.
*Q:* А вот я хочу аналог MCITY встроенный.
*A:* Сгинь нечисть! Всех разумных людей мировой нодлист устраивает больше.
*Q:* Типа эта... А писать куда автору? ;-) *Q:* Типа эта... А писать куда автору? ;-)
*A:* Писать лучше всего в Ru.GoldED. Даже лучше сначала его почитать, потом *A:* Писать лучше всего в Ru.GoldED. Даже лучше сначала его почитать, потом
писать. Если уж сильно приспичит, то можно писать на 2:5020/201.58, писать. Если уж сильно приспичит, то можно писать на 2:5020/201.58,

View File

@ -951,7 +951,7 @@ int ReadKeysCfg(int force) {
while(*ptr) { while(*ptr) {
if(*ptr == '\"') { // Start of literal string if(*ptr == '\"') { // Start of literal string
ptr++; ptr++;
while(*ptr != '\"' and n < 79) { while((*ptr != '\"') and (n < (sizeof(tmp2.buf)/sizeof(gkey)))) {
ch = *ptr++; ch = *ptr++;
tmp2.buf[n++] = (gkey)(ch | (scancode(ch) << 8)); tmp2.buf[n++] = (gkey)(ch | (scancode(ch) << 8));
} }
@ -964,7 +964,7 @@ int ReadKeysCfg(int force) {
int tmpkt; int tmpkt;
keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &tmpkt); keycmd = SwitchKeyDefs(strCrc16(strupr(ptr2)), &tmpkt);
if(keycmd) { if(keycmd) {
if(n < 79) if(n < (sizeof(tmp2.buf)/sizeof(gkey)))
tmp2.buf[n++] = (gkey)keycmd; tmp2.buf[n++] = (gkey)keycmd;
} }
else { else {

View File

@ -113,7 +113,7 @@ void IEclass::setlinetype(Line* __line) {
int IEclass::dispchar(vchar __ch, int attr) { int IEclass::dispchar(vchar __ch, int attr) {
if(__ch == '\0') // possible if line empty if(__ch == NUL) // possible if line empty
__ch = ' '; __ch = ' ';
if(__ch != '\n') { if(__ch != '\n') {
if(__ch == ' ') if(__ch == ' ')

View File

@ -256,7 +256,7 @@ void CfgInit2() {
bool inline samekey(gkey key1, gkey key2) { bool inline samekey(gkey key1, gkey key2) {
if(key1 > 0xff) // special key if(key1 >= KK_Commands) // special key
return false; return false;
return (tolower(key1) == key2) or (toupper(key1) == key2); return (tolower(key1) == key2) or (toupper(key1) == key2);
} }

View File

@ -1609,7 +1609,7 @@ void ScanKludges(GMsg* msg, int getvalue) {
const char* ptr = line->txt.c_str() + 9; const char* ptr = line->txt.c_str() + 9;
ptr = strskip_wht(ptr); ptr = strskip_wht(ptr);
char* tmp = UnwrapLine(line, ptr); char* tmp = UnwrapLine(line, ptr);
KludgeREPLYADDR(msg, tmp ? tmp : ptr); KludgeREPLY_TO(msg, tmp ? tmp : ptr);
if(tmp) if(tmp)
throw_free(tmp); throw_free(tmp);
} }
@ -2639,16 +2639,17 @@ void MsgLineReIndex(GMsg* msg, int viewhidden, int viewkludge, int viewquote) {
if(not viewquote) { if(not viewquote) {
GetQuotestr(line->txt.c_str(), qbuf, &qlen); GetQuotestr(line->txt.c_str(), qbuf, &qlen);
strtrim(qbuf); strtrim(qbuf);
if(strieql(qbuf0, qbuf)) { if(not strieql(qbuf0, qbuf)) {
if(strpbrk(line->txt.c_str()+qlen, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"))
qmatches++;
}
else {
strcpy(qbuf0, qbuf); strcpy(qbuf0, qbuf);
if(strpbrk(line->txt.c_str()+qlen, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")) qmatches = 0;
qmatches = 1; }
else const char *p = line->txt.c_str()+qlen;
qmatches = 0; while(*p != NUL) {
if(isxalnum(*p)) {
qmatches++;
break;
}
++p;
} }
if(qmatches != 1) { if(qmatches != 1) {
line = line->next; line = line->next;
@ -2977,6 +2978,8 @@ char* ParseInternetAddr(char* __string, char* __name, char* __addr) {
StripQuotes(__name); StripQuotes(__name);
strxmimecpy(__name, __name, 0, strlen(__name), true);
return __name; return __name;
} }

View File

@ -868,6 +868,23 @@ void GThreadlist::close() {
void GThreadlist::GenTree(char* buf, int idx) { void GThreadlist::GenTree(char* buf, int idx) {
#ifdef KOI8
static char graph[4]="†„<EFBFBD>";
#else
static char graph_ibmpc[4]="ÃÀ³";
static char graph[]="";
if(graph[0] == NUL) {
int table = LoadCharset(NULL, NULL, 1);
int level = LoadCharset("IBMPC", CFG->xlatlocalset);
XlatStr(graph, graph_ibmpc, level, CharTable);
if(table == -1)
LoadCharset(CFG->xlatimport, CFG->xlatlocalset);
else
LoadCharset(CFG->xlatcharset[table].imp, CFG->xlatcharset[table].exp);
}
#endif
t = list[idx]; t = list[idx];
uint level = 0; uint level = 0;
@ -875,7 +892,7 @@ void GThreadlist::GenTree(char* buf, int idx) {
*q-- = NUL; *q-- = NUL;
*q-- = ' '; *q-- = ' ';
*q-- = (t.replynext) ? 'Ã' : 'À'; *q-- = (t.replynext) ? graph[0] : graph[1];
while(t.replyto) { while(t.replyto) {
for(uint i=0; i<list.size(); i++) { for(uint i=0; i<list.size(); i++) {
@ -886,7 +903,7 @@ void GThreadlist::GenTree(char* buf, int idx) {
} }
} }
*q-- = ' '; *q-- = ' ';
*q-- = (t.replynext) ? '³' : ' '; *q-- = (t.replynext) ? graph[2] : ' ';
} }
t = list[idx]; t = list[idx];

View File

@ -102,16 +102,17 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
char xmailer[356]; char xmailer[356];
get_informative_string(xmailer); get_informative_string(xmailer);
struct tm* written_tm = gmtime(&msg->written); time_t t = time(NULL);
char cdate[32]; struct tm* written_tm = localtime(&t);
strftimei(cdate, 32, LNG->DateFmt, written_tm); char cdate[80];
char ctime[32]; strftimei(cdate, 80, LNG->DateFmt, written_tm);
strftimei(ctime, 32, LNG->TimeFmt, written_tm); char ctime[80];
strftimei(ctime, 80, LNG->TimeFmt, written_tm);
written_tm = gmtime(&oldmsg->written); written_tm = gmtime(&oldmsg->written);
char odate[32]; char odate[80];
strftimei(odate, 32, LNG->DateFmt, written_tm); strftimei(odate, 80, LNG->DateFmt, written_tm);
char otime[32]; char otime[80];
strftimei(otime, 32, LNG->TimeFmt, written_tm); strftimei(otime, 80, LNG->TimeFmt, written_tm);
const char* osslashbuf = __gver_platform__; const char* osslashbuf = __gver_platform__;
@ -120,7 +121,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
bool currareaisinet = AA->isinternet(); bool currareaisinet = AA->isinternet();
char* modereptr = oldmsg->re; char* modereptr = oldmsg->re;
if(mode == MODE_QUOTE or mode == MODE_REPLYCOMMENT or mode == MODE_REPLY) { if((mode == MODE_QUOTE) or (mode == MODE_REPLYCOMMENT) or (mode == MODE_REPLY)) {
if(AL.AreaIdToPtr(__origarea)->Areareplydirect() and oldmsg->areakludgeid) if(AL.AreaIdToPtr(__origarea)->Areareplydirect() and oldmsg->areakludgeid)
origareaid = oldmsg->areakludgeid; origareaid = oldmsg->areakludgeid;
} }
@ -309,7 +310,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
tokenxchg(dst, "@fpseudo", msg->pseudofrom); tokenxchg(dst, "@fpseudo", msg->pseudofrom);
continue; continue;
} }
if(tokenxchg(dst, "@cpseudo", *AA->Nickname() ? AA->Nickname() : strlword(strcpy(buf, AA->Username().name)))) if(tokenxchg(dst, "@cpseudo", *AA->Nickname() ? AA->Nickname() : strlword(strcpy(buf, AA->Username().name), " @")))
continue; continue;
if(tokenxchg(dst, "@version", longverbuf)) if(tokenxchg(dst, "@version", longverbuf))
continue; continue;

View File

@ -687,7 +687,7 @@ static void GetLastLink(GMsg* msg, ulong& msgno) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void MakeMsg(int mode, GMsg* omsg) { void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
GFTRK("MakeMsg"); GFTRK("MakeMsg");
@ -833,6 +833,8 @@ void MakeMsg(int mode, GMsg* omsg) {
case MODE_REPLYCOMMENT: case MODE_REPLYCOMMENT:
omsg->attr.tou0(); omsg->attr.tou0();
omsg->TextToLines(-CFG->quotemargin, false); omsg->TextToLines(-CFG->quotemargin, false);
if(ignore_replyto)
omsg->ireplyto[0] = NUL;
if(omsg->attr.rot()) if(omsg->attr.rot())
Rot13(omsg); Rot13(omsg);
// Drop through // Drop through

View File

@ -255,7 +255,7 @@ bool set_to_address(GMsg* msg, gsetaddr* toname, gsetaddr* toaddr, gsetaddr* fro
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// GEPOST prototypes // GEPOST prototypes
void MakeMsg(int mode, GMsg* oldmsg); void MakeMsg(int mode, GMsg* oldmsg, bool ignore_replyto=false);
int EditHeaderinfo(int mode, GMsgHeaderView &view); int EditHeaderinfo(int mode, GMsgHeaderView &view);
void CheckSubject(GMsg* msg, char* subj); void CheckSubject(GMsg* msg, char* subj);
@ -315,13 +315,11 @@ void MarkingOptions();
void MessageBrowse(); void MessageBrowse();
void NewArea(bool jumpnext = false); void NewArea(bool jumpnext = false);
void NewMsg(); void NewMsg();
void OtherAreaQuoteMsg(); void OtherAreaQuoteMsg(bool ignore_replyto=false);
void OtherAreaDirQuoteMsg();
void OtherAreaCommentMsg(); void OtherAreaCommentMsg();
void QuitNow(); void QuitNow();
void QuoteBuf(GMsg* msg); void QuoteBuf(GMsg* msg);
void DirQuoteMsg(); void QuoteMsg(bool ignore_replyto=false);
void QuoteMsg();
void RenumberArea(); void RenumberArea();
void ReplyMsg(); void ReplyMsg();
void ToggleBookMark(); void ToggleBookMark();

View File

@ -602,11 +602,11 @@ void Reader() {
break; break;
case KK_ReadMoveQuoteMsg: case KK_ReadMoveQuoteMsg:
OtherAreaQuoteMsg(); OtherAreaQuoteMsg(false);
break; break;
case KK_ReadMoveDirQuoteMsg: case KK_ReadMoveDirQuoteMsg:
OtherAreaDirQuoteMsg(); OtherAreaQuoteMsg(true);
break; break;
case KK_ReadMoveCommentMsg: case KK_ReadMoveCommentMsg:
@ -618,11 +618,11 @@ void Reader() {
break; break;
case KK_ReadQuoteMsg: case KK_ReadQuoteMsg:
QuoteMsg(); QuoteMsg(false);
break; break;
case KK_ReadDirQuoteMsg: case KK_ReadDirQuoteMsg:
DirQuoteMsg(); QuoteMsg(true);
break; break;
case KK_ReadCommentMsg: case KK_ReadCommentMsg:

View File

@ -252,13 +252,13 @@ int TemplateToText(int mode, GMsg* msg, GMsg* oldmsg, const char* tpl, int origa
// build @tpseudo // build @tpseudo
if(is_user(msg->to)) if(is_user(msg->to))
strcpy(msg->pseudoto, *AA->Nickname() ? AA->Nickname() : strlword(msg->to)); strcpy(msg->pseudoto, *AA->Nickname() ? AA->Nickname() : strlword(msg->to, " @"));
else else
*(msg->pseudoto) = NUL; *(msg->pseudoto) = NUL;
// build @fpseudo // build @fpseudo
if(is_user(msg->By())) if(is_user(msg->By()))
strcpy(msg->pseudofrom, *AA->Nickname() ? AA->Nickname() : strlword(msg->By())); strcpy(msg->pseudofrom, *AA->Nickname() ? AA->Nickname() : strlword(msg->By(), " @"));
else else
*(msg->pseudofrom) = NUL; *(msg->pseudofrom) = NUL;
@ -944,16 +944,7 @@ void ReplyMsg() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void DirQuoteMsg() { void QuoteMsg(bool ignore_replyto) {
if(reader_msg->ireplyto) *reader_msg->ireplyto = NUL;
QuoteMsg();
}
// ------------------------------------------------------------------
void QuoteMsg() {
if(CurrArea == OrigArea) { if(CurrArea == OrigArea) {
if(AA->Areareplydirect() and reader_msg->areakludgeid) { if(AA->Areareplydirect() and reader_msg->areakludgeid) {
@ -978,7 +969,7 @@ void QuoteMsg() {
reader_keyok = not MenuReadonly.Run(); reader_keyok = not MenuReadonly.Run();
} }
if(not reader_keyok) if(not reader_keyok)
MakeMsg(MODE_QUOTE, reader_msg); MakeMsg(MODE_QUOTE, reader_msg, ignore_replyto);
} }
} }
@ -1017,16 +1008,7 @@ void CommentMsg() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void OtherAreaDirQuoteMsg() { void OtherAreaQuoteMsg(bool ignore_replyto) {
if(reader_msg->ireplyto) *reader_msg->ireplyto = NUL;
OtherAreaQuoteMsg();
}
// ------------------------------------------------------------------
void OtherAreaQuoteMsg() {
if(AA->Msgn.Count()) { if(AA->Msgn.Count()) {
int destarea = CurrArea; int destarea = CurrArea;
@ -1063,7 +1045,7 @@ void OtherAreaQuoteMsg() {
AA->adat->viewquote = adat_viewquote; AA->adat->viewquote = adat_viewquote;
} }
} }
QuoteMsg(); QuoteMsg(ignore_replyto);
if(CurrArea != OrigArea) { if(CurrArea != OrigArea) {
AA->Close(); AA->Close();
AL.SetActiveAreaId(OrigArea); AL.SetActiveAreaId(OrigArea);

View File

@ -848,7 +848,7 @@ bool guserbase::lookup_addressbook(GMsg* msg, char* name, char* aka, bool browse
void guserbase::build_pseudo(GMsg* msg, char* name, char* aka, bool direction) { void guserbase::build_pseudo(GMsg* msg, char* name, char* aka, bool direction) {
strcpy(direction ? msg->pseudoto : msg->pseudofrom, strlword(name)); strcpy(direction ? msg->pseudoto : msg->pseudofrom, strlword(name, " @"));
if(find_entry(name, true) and not entry.is_deleted) { if(find_entry(name, true) and not entry.is_deleted) {

View File

@ -1171,8 +1171,6 @@ gkey kbxget_raw(int mode) {
WORD &VKC = inp.Event.KeyEvent.wVirtualKeyCode; WORD &VKC = inp.Event.KeyEvent.wVirtualKeyCode;
char &ascii = inp.Event.KeyEvent.uChar.AsciiChar; char &ascii = inp.Event.KeyEvent.uChar.AsciiChar;
// Get next key
inp.Event.KeyEvent.bKeyDown = false;
while(1) { while(1) {
PeekConsoleInput(gkbd_hin, &inp, 1, &nread); PeekConsoleInput(gkbd_hin, &inp, 1, &nread);

View File

@ -87,8 +87,8 @@ char* strnp2c(char* str, int n);
char* strnp2cc(char* dest, const char* str, int n); char* strnp2cc(char* dest, const char* str, int n);
char* strp2c(char* str); char* strp2c(char* str);
const char* strlword(const char* str); const char* strlword(const char* str, const char *separator=NULL);
const char* strrword(const char* str); const char* strrword(const char* str, const char *separator=NULL);
char* strrevname(char* reversedname, const char* name); char* strrevname(char* reversedname, const char* name);
char* strunrevname(char* unreversedname, const char* name); char* strunrevname(char* unreversedname, const char* name);

View File

@ -487,7 +487,7 @@ char* strltrim(char* str) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
const char* strlword(const char* str) { const char* strlword(const char* str, const char *separator) {
char buf[256]; char buf[256];
static char left[40]; static char left[40];
@ -495,7 +495,7 @@ const char* strlword(const char* str) {
*left = NUL; *left = NUL;
if(*str) { if(*str) {
strxcpy(buf, str, sizeof(buf)); strxcpy(buf, str, sizeof(buf));
if(strtok(buf, " ") != NULL) { if(strtok(buf, (separator == NULL) ? " \t\n\r" : separator) != NULL) {
strxcpy(left, buf, sizeof(left)); strxcpy(left, buf, sizeof(left));
} }
} }
@ -505,7 +505,7 @@ const char* strlword(const char* str) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
const char* strrword(const char* str) { const char* strrword(const char* str, const char *separator) {
char* ptr; char* ptr;
char* ptr2; char* ptr2;
@ -515,11 +515,14 @@ const char* strrword(const char* str) {
*right = NUL; *right = NUL;
if(*str) { if(*str) {
strxcpy(buf, str, sizeof(buf)); strxcpy(buf, str, sizeof(buf));
ptr = strtok(buf, " "); if(separator == NULL) {
separator = " \t\n\r";
}
ptr = strtok(buf, separator);
ptr2 = ptr; ptr2 = ptr;
while(ptr != NULL) { while(ptr != NULL) {
ptr2 = ptr; ptr2 = ptr;
ptr = strtok(NULL, " "); ptr = strtok(NULL, separator);
} }
if(ptr2) { if(ptr2) {
strxcpy(right, ptr2, sizeof(right)); strxcpy(right, ptr2, sizeof(right));

View File

@ -204,7 +204,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
break; break;
case JAMSUB_TRACE: case JAMSUB_TRACE:
sprintf(_kludges+strlen(_kludges), "\001VIA: %s\r", _buf); sprintf(_kludges+strlen(_kludges2), "\001Via %s\r", _buf);
// Not processed // Not processed
break; break;
@ -289,7 +289,7 @@ int JamArea::load_message(int __mode, gmsg* __msg, JamHdr& __hdr) {
break; break;
case JAMSUB_TZUTCINFO: case JAMSUB_TZUTCINFO:
sprintf(_kludges+strlen(_kludges), "\001TZUTCINFO: %s\r", _buf); sprintf(_kludges+strlen(_kludges), "\001TZUTC: %s\r", _buf);
// Not processed // Not processed
break; break;
} }

View File

@ -2,7 +2,7 @@
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Route Diagram Drawing Tool. // Route Diagram Drawing Tool.
// Copyright (C) 1999 Odinn Sorensen // Copyright (C) 1999 Odinn Sorensen
// Copyright (C) 1999-2000 Alexander S. Aganichev // Copyright (C) 1999-2001 Alexander S. Aganichev
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as // modify it under the terms of the GNU General Public License as
@ -248,18 +248,30 @@ void nodetree::print() {
} }
} }
if(above and below) if(above and below) {
#ifdef KOI8
strcpy(buf, "<EFBFBD>");
#else
strcpy(buf, "³"); strcpy(buf, "³");
else #endif
} else
*buf = NUL; *buf = NUL;
strsetsz(buf, indent); strsetsz(buf, indent);
n->display += buf; n->display += buf;
} }
if(n->depth) { if(n->depth) {
#ifdef KOI8
strcpy(buf, "");
#else
strcpy(buf, "À"); strcpy(buf, "À");
#endif
strsetsz(buf, indent); strsetsz(buf, indent);
#ifdef KOI8
strchg(buf, ' ', '');
#else
strchg(buf, ' ', 'Ä'); strchg(buf, ' ', 'Ä');
#endif
n->display += buf; n->display += buf;
} }
@ -271,11 +283,20 @@ void nodetree::print() {
for(n=nodes.begin(); n != nodes.end(); n++) { for(n=nodes.begin(); n != nodes.end(); n++) {
list_node::iterator x=n; list_node::iterator x=n;
if(++x != nodes.end()) { if(++x != nodes.end()) {
#ifdef KOI8
const char* p = strchr(n->display.c_str(), '');
#else
const char* p = strchr(n->display.c_str(), 'À'); const char* p = strchr(n->display.c_str(), 'À');
#endif
if(p) { if(p) {
int len = p - n->display.c_str(); int len = p - n->display.c_str();
#ifdef KOI8
if((x->display[len] == '<EFBFBD>') or (x->display[len] == ''))
n->display[len] = '';
#else
if((x->display[len] == '³') or (x->display[len] == 'À')) if((x->display[len] == '³') or (x->display[len] == 'À'))
n->display[len] = 'Ã'; n->display[len] = 'Ã';
#endif
} }
} }
n->display.resize(maxdisp, ' '); n->display.resize(maxdisp, ' ');
@ -298,9 +319,13 @@ int main(int argc, char** argv) {
// set locale // set locale
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
cout << "Route Diagram Drawing Tool 1.1" << endl #ifdef KOI8
cout << "Route Diagram Drawing Tool 1.1.1 (koi8)" << endl
#else
cout << "Route Diagram Drawing Tool 1.1.1" << endl
#endif
<< "Copyright (C) 1999 Odinn Sorensen" << endl << "Copyright (C) 1999 Odinn Sorensen" << endl
<< "Copyright (C) 1999-2000 Alexander S. Aganichev" << endl << "Copyright (C) 1999-2001 Alexander S. Aganichev" << endl
<< "----------------------------------------------------------------------" << endl << "----------------------------------------------------------------------" << endl
<< endl; << endl;