Fix numerical groups, packed feature
This commit is contained in:
parent
0d12457466
commit
389bf63f62
@ -12,6 +12,13 @@ ______________________________________________________________________
|
||||
Notes for GoldED+ 1.1.5, /snapshot/
|
||||
______________________________________________________________________
|
||||
|
||||
- Fixed packed messagebase operation. The feature was only implemented
|
||||
for the Squish messagebase and even there scan was improperly
|
||||
implemented.
|
||||
|
||||
- Fixed numerical group parsing for Crashmail/CrashEcho, HPT,
|
||||
SpaceToss, QEcho and Partoss.
|
||||
|
||||
- Fixed reverse order sorting in 'M' criteria of AREALISTSORT (broken
|
||||
in previous snapshots).
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// The Goldware Library
|
||||
// Copyright (C) 1999-2000 Alexander S. Aganichev
|
||||
// Copyright (C) 1999-2002 Alexander S. Aganichev
|
||||
// ------------------------------------------------------------------
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
@ -217,8 +217,12 @@ void gareafile::ReadCrashmailCfg(const char* file) {
|
||||
unconfirmed = true;
|
||||
break;
|
||||
case CRC_GROUP:
|
||||
if(jbstrcpy(tmp, buf, 100, &jbcpos))
|
||||
aa.groupid = toupper(tmp[0]);
|
||||
if(jbstrcpy(tmp, buf, 100, &jbcpos)) {
|
||||
if(isdigit(tmp[0]))
|
||||
aa.groupid = 0x8000+atoi(tmp);
|
||||
else if(isalpha(tmp[0]))
|
||||
aa.groupid = toupper(tmp[0]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// The Goldware Library
|
||||
// Copyright (C) 1999-2000 Alexander S. Aganichev
|
||||
// Copyright (C) 1999-2002 Alexander S. Aganichev
|
||||
// ------------------------------------------------------------------
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
@ -301,7 +301,9 @@ void gareafile::ReadHPTFile(char* path, char* file, char* options, char* origin,
|
||||
|
||||
gettok(&key, &val);
|
||||
|
||||
if(isalpha(*key))
|
||||
if(isdigit(*key))
|
||||
aa.groupid = 0x8000+atoi(key);
|
||||
else if(isalpha(*key))
|
||||
aa.groupid = toupper(*key);
|
||||
}
|
||||
else if (strieql(opt, "d")) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// The Goldware Library
|
||||
// Copyright (C) 1999 Alexander S. Aganichev
|
||||
// Copyright (C) 1999, 2002 Alexander S. Aganichev
|
||||
// ------------------------------------------------------------------
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
@ -49,7 +49,11 @@ void gareafile::ReadQEchoFile(char* file, char* options, char* origin) {
|
||||
|
||||
char* ptr = strtok(buf, " \t");
|
||||
aa.reset();
|
||||
aa.groupid = atoi(ptr);
|
||||
|
||||
if(isdigit(*ptr))
|
||||
aa.groupid = 0x8000+atoi(ptr);
|
||||
else if(isalpha(*ptr))
|
||||
aa.groupid = toupper(*ptr);
|
||||
|
||||
if((ptr = strtok(NULL, " \t")) != NULL) {
|
||||
if(*ptr == '*') {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// The Goldware Library
|
||||
// Copyright (C) 1999-2000 Alexander S. Aganichev
|
||||
// Copyright (C) 1999-2002 Alexander S. Aganichev
|
||||
// ------------------------------------------------------------------
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
@ -139,7 +139,10 @@ void gareafile::ReadSpaceAr(const char* file) {
|
||||
break;
|
||||
}
|
||||
case CRC_GROUP:
|
||||
aa.groupid = toupper(*val);
|
||||
if(isdigit(*val))
|
||||
aa.groupid = 0x8000+atoi(val);
|
||||
else if(isalpha(*val))
|
||||
aa.groupid = toupper(*val);
|
||||
break;
|
||||
case CRC_ENDAREA:
|
||||
if(aa.msgbase)
|
||||
|
@ -118,8 +118,12 @@ void gareafile::ReadSquishFile(char* path, char* file, char* options, char* orig
|
||||
if(strnieql(p, "-$", 2)) {
|
||||
aa.msgbase = GMB_SQUISH;
|
||||
p += 2;
|
||||
if((tolower(*p) == 'g') and isalpha(p[1]))
|
||||
aa.groupid = toupper(p[1]);
|
||||
if((tolower(*p) == 'g') and isalpha(p[1])) {
|
||||
if(isdigit(p[1]))
|
||||
aa.groupid = 0x8000+atoi(p+1);
|
||||
else if(isalpha(p[1]))
|
||||
aa.groupid = toupper(p[1]);
|
||||
}
|
||||
else if(tolower(*p) == 'n') {
|
||||
key = ++p;
|
||||
getkeyval(&key, &p);
|
||||
|
@ -36,6 +36,12 @@ void EzycomArea::raw_scan(int __keep_index) {
|
||||
|
||||
int _wasopen = isopen;
|
||||
if(not _wasopen) {
|
||||
if(ispacked()) {
|
||||
const char* newpath = Unpack(path());
|
||||
if(newpath == NULL)
|
||||
packed(false);
|
||||
set_real_path(newpath ? newpath : path());
|
||||
}
|
||||
isopen++;
|
||||
data_open();
|
||||
test_raw_open(__LINE__);
|
||||
@ -107,6 +113,9 @@ void EzycomArea::raw_scan(int __keep_index) {
|
||||
if(not _wasopen) {
|
||||
raw_close();
|
||||
data_close();
|
||||
if(ispacked()) {
|
||||
CleanUnpacked(real_path());
|
||||
}
|
||||
isopen--;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ void FidoArea::data_close() {
|
||||
|
||||
char* FidoArea::build_msgname(char* __buf, ulong __msgno) {
|
||||
|
||||
sprintf(__buf, "%s%lu.msg", path(), __msgno);
|
||||
sprintf(__buf, "%s%lu.msg", real_path(), __msgno);
|
||||
return __buf;
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ void FidoArea::save_lastread() {
|
||||
|
||||
GFTRK("FidoSaveLastread");
|
||||
|
||||
int _fh = ::sopen(AddPath(path(), wide->fidolastread), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
|
||||
int _fh = ::sopen(AddPath(real_path(), wide->fidolastread), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
|
||||
if(_fh != -1) {
|
||||
word _lastread = (word)Msgn->CvtReln(lastread);
|
||||
lseekset(_fh, wide->userno, sizeof(word));
|
||||
|
@ -37,11 +37,22 @@ void FidoArea::raw_scan(bool __scanpm) {
|
||||
|
||||
GFTRK("FidoArea::raw_scan");
|
||||
|
||||
int _wasopen = isopen;
|
||||
if(not _wasopen) {
|
||||
isopen++;
|
||||
if(ispacked()) {
|
||||
const char* newpath = Unpack(path());
|
||||
if(newpath == NULL)
|
||||
packed(false);
|
||||
set_real_path(newpath ? newpath : path());
|
||||
}
|
||||
}
|
||||
|
||||
register uint _active = 0;
|
||||
register ulong* _msgnoptr = NULL;
|
||||
register ulong* _msgndx = Msgn->tag;
|
||||
|
||||
gposixdir d(path());
|
||||
gposixdir d(real_path());
|
||||
if(WideDebug)
|
||||
WideLog->printf("- %s/*.msg", d.fullpath());
|
||||
const gdirentry *de;
|
||||
@ -65,7 +76,7 @@ void FidoArea::raw_scan(bool __scanpm) {
|
||||
|
||||
// Get the lastread msgno
|
||||
word _lastread = 0;
|
||||
int _fh = ::sopen(AddPath(path(), wide->fidolastread), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
int _fh = ::sopen(AddPath(real_path(), wide->fidolastread), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
if(_fh != -1) {
|
||||
lseekset(_fh, wide->userno, sizeof(word));
|
||||
read(_fh, &_lastread, sizeof(word));
|
||||
@ -113,7 +124,7 @@ void FidoArea::raw_scan(bool __scanpm) {
|
||||
// Read highwater mark
|
||||
data->highwatermark = 0;
|
||||
if(isecho() and wide->fidohwmarks) {
|
||||
_fh = test_open(AddPath(path(), "1.msg"), O_RDONLY|O_BINARY, WideSharemode);
|
||||
_fh = test_open(AddPath(real_path(), "1.msg"), O_RDONLY|O_BINARY, WideSharemode);
|
||||
if(_fh != -1) {
|
||||
read(_fh, &_hdr, sizeof(FidoHdr));
|
||||
data->highwatermark = _hdr.replyto;
|
||||
@ -175,6 +186,13 @@ void FidoArea::raw_scan(bool __scanpm) {
|
||||
);
|
||||
}
|
||||
|
||||
if(not _wasopen) {
|
||||
if(ispacked()) {
|
||||
CleanUnpacked(real_path());
|
||||
}
|
||||
isopen--;
|
||||
}
|
||||
|
||||
GFTRK(NULL);
|
||||
}
|
||||
|
||||
|
@ -75,8 +75,8 @@ int FidoArea::renumber() {
|
||||
if(_msgno != Msgn->at(_count)) {
|
||||
|
||||
Path _oldname, _newname;
|
||||
sprintf(_oldname, "%s%lu.msg", path(), Msgn->at(_count));
|
||||
sprintf(_newname, "%s%lu.msg", path(), _msgno);
|
||||
sprintf(_oldname, "%s%lu.msg", real_path(), Msgn->at(_count));
|
||||
sprintf(_newname, "%s%lu.msg", real_path(), _msgno);
|
||||
|
||||
// Get the file attribute of the message
|
||||
struct stat st;
|
||||
@ -152,7 +152,7 @@ Line* FidoArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
|
||||
AddLine (NULL, "Hexdump of Fido/Opus-style message header and text");
|
||||
AddLineF(line, "------------------------------------------------------------------------------");
|
||||
line = AddLine(line, "");
|
||||
AddLineF(line, "File : %s%lu.msg", path(), msg->msgno);
|
||||
AddLineF(line, "File : %s%lu.msg", real_path(), msg->msgno);
|
||||
AddLineF(line, "From : %-35.35s", _hdr.by);
|
||||
AddLineF(line, "To : %-35.35s", _hdr.to);
|
||||
AddLineF(line, "Subject : %-72.72s", _hdr.re);
|
||||
|
@ -97,13 +97,13 @@ void JamArea::raw_open() {
|
||||
GFTRK("JamArea::raw_open");
|
||||
|
||||
Path file;
|
||||
sprintf(file, "%s.jhr", path()); data->fhjhr = test_open(file);
|
||||
sprintf(file, "%s.jdx", path()); data->fhjdx = test_open(file);
|
||||
sprintf(file, "%s.jlr", path()); data->fhjlr = test_open(file);
|
||||
sprintf(file, "%s.jhr", real_path()); data->fhjhr = test_open(file);
|
||||
sprintf(file, "%s.jdx", real_path()); data->fhjdx = test_open(file);
|
||||
sprintf(file, "%s.jlr", real_path()); data->fhjlr = test_open(file);
|
||||
if(not just_scanning) {
|
||||
sprintf(file, "%s.jdt", path()); data->fhjdt = test_open(file);
|
||||
sprintf(file, "%s.jdt", real_path()); data->fhjdt = test_open(file);
|
||||
if(not jamwide->smapihw) {
|
||||
sprintf(file, "%s.cmhw", path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW);
|
||||
sprintf(file, "%s.cmhw", real_path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW);
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,6 +208,12 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
if(not _was_open) {
|
||||
if(not __keep_index or __scanpm)
|
||||
just_scanning = true;
|
||||
if(ispacked()) {
|
||||
const char* newpath = Unpack(path());
|
||||
if(newpath == NULL)
|
||||
packed(false);
|
||||
set_real_path(newpath ? newpath : path());
|
||||
}
|
||||
isopen++;
|
||||
data_open();
|
||||
open_area();
|
||||
@ -325,7 +331,6 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Free the .JDX buffer
|
||||
throw_free(_jdxbuf);
|
||||
|
||||
@ -333,6 +338,9 @@ void JamArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
if(not _was_open) {
|
||||
raw_close();
|
||||
data_close();
|
||||
if(ispacked()) {
|
||||
CleanUnpacked(real_path());
|
||||
}
|
||||
isopen--;
|
||||
}
|
||||
|
||||
|
@ -48,11 +48,11 @@ void JamArea::lock() {
|
||||
while(::lock(data->fhjhr, 0, 1) == -1) {
|
||||
|
||||
// Tell the world
|
||||
if(PopupLocked(++_tries, true, path()) == false) {
|
||||
if(PopupLocked(++_tries, true, real_path()) == false) {
|
||||
WideLog->ErrLock();
|
||||
raw_close();
|
||||
WideLog->printf("! A JAM msgbase file could not be locked.");
|
||||
WideLog->printf(": %s.JHR.", path());
|
||||
WideLog->printf(": %s.jhr.", real_path());
|
||||
WideLog->ErrOSInfo();
|
||||
LockErrorExit();
|
||||
}
|
||||
@ -72,7 +72,7 @@ void JamArea::lock() {
|
||||
if(not jamwide->smapihw) {
|
||||
if(data->fhjhw == -1) {
|
||||
Path file;
|
||||
sprintf(file, "%s.cmhw", path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW);
|
||||
sprintf(file, "%s.cmhw", real_path()); data->fhjhw = ::sopen(file, O_RDWR|O_BINARY, WideSharemode, S_STDRW);
|
||||
}
|
||||
if(data->fhjhw != -1) {
|
||||
lseek(data->fhjhw, 0, SEEK_SET);
|
||||
|
@ -93,7 +93,7 @@ Line* JamArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
|
||||
AddLine (NULL, "Hexdump of JAM message header, subfields and text");
|
||||
AddLineF(line, "------------------------------------------------------------------------------");
|
||||
line = AddLine(line, "");
|
||||
AddLineF(line, "Msgbase : %s", path());
|
||||
AddLineF(line, "Msgbase : %s", real_path());
|
||||
AddLineF(line, "Signature : %s", _hdr->signature);
|
||||
AddLineF(line, "Revision : %u", _hdr->revision);
|
||||
AddLineF(line, "ReservedWord : %u", _hdr->reservedword);
|
||||
|
@ -202,8 +202,8 @@ void PcbArea::raw_open() {
|
||||
GFTRK("PcbRawOpen");
|
||||
|
||||
if(not just_scanning)
|
||||
data->fhmsg = test_open(path());
|
||||
data->fhidx = test_open(AddPath(path(), ".idx"));
|
||||
data->fhmsg = test_open(real_path());
|
||||
data->fhidx = test_open(AddPath(real_path(), ".idx"));
|
||||
|
||||
GFTRK(NULL);
|
||||
}
|
||||
@ -220,6 +220,12 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
if(not _was_open) {
|
||||
if(not __keep_index)
|
||||
just_scanning = true;
|
||||
if(ispacked()) {
|
||||
const char* newpath = Unpack(path());
|
||||
if(newpath == NULL)
|
||||
packed(false);
|
||||
set_real_path(newpath ? newpath : path());
|
||||
}
|
||||
isopen++;
|
||||
data_open();
|
||||
raw_open();
|
||||
@ -345,6 +351,9 @@ void PcbArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
if(not _was_open) {
|
||||
raw_close();
|
||||
data_close();
|
||||
if(ispacked()) {
|
||||
CleanUnpacked(real_path());
|
||||
}
|
||||
isopen--;
|
||||
}
|
||||
|
||||
|
@ -45,11 +45,11 @@ void PcbArea::lock() {
|
||||
if(WideCanLock) {
|
||||
long _tries = 0;
|
||||
while(::lock(data->fhmsg, 16, 6) == -1) {
|
||||
if(PopupLocked(++_tries, true, path()) == false) {
|
||||
if(PopupLocked(++_tries, true, real_path()) == false) {
|
||||
WideLog->ErrLock();
|
||||
raw_close();
|
||||
WideLog->printf("! A PCBoard msgbase file could not be locked.");
|
||||
WideLog->printf(": %s.", path());
|
||||
WideLog->printf(": %s.", real_path());
|
||||
WideLog->ErrOSInfo();
|
||||
LockErrorExit();
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ Line* PcbArea::make_dump_msg(Line*& lin, gmsg* __msg, char* lng_head) {
|
||||
AddLine (NULL, "Hexdump of PCBoard message header and text");
|
||||
AddLineF(line, "------------------------------------------------------------------------------");
|
||||
line = AddLine(line, "");
|
||||
AddLineF(line, "Msgbase : %s", path());
|
||||
AddLineF(line, "Msgbase : %s", real_path());
|
||||
AddLineF(line, "BoardNo : %u", board());
|
||||
AddLineF(line, "MsgOffset : %li", _idx.offset);
|
||||
AddLineF(line, "Status : \'%c\'", _hdr.status);
|
||||
|
@ -60,7 +60,7 @@ void SMBInit() {
|
||||
void SMBArea::data_open() {
|
||||
|
||||
data = smbdata + (smbdatano++);
|
||||
strxcpy(data->file, path(), sizeof(data->file) - 3);
|
||||
strxcpy(data->file, real_path(), sizeof(data->file) - 3);
|
||||
data->sdt_fp = data->shd_fp = data->sid_fp = data->sda_fp = data->sha_fp = NULL;
|
||||
data->retry_time = 1;
|
||||
data->last_error[0] = NUL;
|
||||
@ -113,7 +113,7 @@ void SMBArea::open() {
|
||||
// User requested to exit
|
||||
WideLog->ErrOpen();
|
||||
WideLog->printf("! Synchronet message base could not be opened (%s).", data->last_error);
|
||||
WideLog->printf(": %s", path());
|
||||
WideLog->printf(": %s", real_path());
|
||||
WideLog->ErrOSInfo();
|
||||
OpenErrorExit();
|
||||
}
|
||||
@ -136,7 +136,7 @@ void SMBArea::open() {
|
||||
|
||||
WideLog->ErrOpen();
|
||||
WideLog->printf("! Synchronet message base could not be created (%s).", data->last_error);
|
||||
WideLog->printf(": %s", path());
|
||||
WideLog->printf(": %s", real_path());
|
||||
WideLog->ErrOSInfo();
|
||||
OpenErrorExit();
|
||||
}
|
||||
@ -199,7 +199,7 @@ void SMBArea::resume()
|
||||
// User requested to exit
|
||||
WideLog->ErrOpen();
|
||||
WideLog->printf("! Synchronet message base could not be opened (%s).", data->last_error);
|
||||
WideLog->printf(": %s", path());
|
||||
WideLog->printf(": %s", real_path());
|
||||
WideLog->ErrOSInfo();
|
||||
OpenErrorExit();
|
||||
}
|
||||
@ -222,7 +222,7 @@ void SMBArea::resume()
|
||||
|
||||
WideLog->ErrOpen();
|
||||
WideLog->printf("! Synchronet message base could not be created (%s).", data->last_error);
|
||||
WideLog->printf(": %s", path());
|
||||
WideLog->printf(": %s", real_path());
|
||||
WideLog->ErrOSInfo();
|
||||
OpenErrorExit();
|
||||
}
|
||||
|
@ -36,8 +36,15 @@ void SMBArea::raw_scan(bool keep_index, bool scanpm)
|
||||
GFTRK("SMBArea::raw_scan");
|
||||
|
||||
smb_t *_was_data = data;
|
||||
if(_was_data == NULL)
|
||||
if(_was_data == NULL) {
|
||||
if(ispacked()) {
|
||||
const char* newpath = Unpack(path());
|
||||
if(newpath == NULL)
|
||||
packed(false);
|
||||
set_real_path(newpath ? newpath : path());
|
||||
}
|
||||
data_open();
|
||||
}
|
||||
ulong firstmsgno = 0;
|
||||
ulong lastmsgno = 0;
|
||||
Msgn->Reset();
|
||||
@ -105,8 +112,12 @@ void SMBArea::raw_scan(bool keep_index, bool scanpm)
|
||||
scanpm ? (int)PMrk->Count() : -1
|
||||
);
|
||||
}
|
||||
if(_was_data == NULL)
|
||||
if(_was_data == NULL) {
|
||||
data_close();
|
||||
if(ispacked()) {
|
||||
CleanUnpacked(real_path());
|
||||
}
|
||||
}
|
||||
|
||||
GFTRK(NULL);
|
||||
}
|
||||
|
@ -83,6 +83,17 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
wide = squishwide;
|
||||
}
|
||||
|
||||
int _wasopen = isopen;
|
||||
if(not _wasopen) {
|
||||
if(ispacked()) {
|
||||
const char* newpath = Unpack(path());
|
||||
if(newpath == NULL)
|
||||
packed(false);
|
||||
set_real_path(newpath ? newpath : path());
|
||||
}
|
||||
isopen++;
|
||||
}
|
||||
|
||||
// Load the lastread
|
||||
dword _lastread = 0;
|
||||
int _fh = ::sopen(AddPath(real_path(), ".sql"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
@ -93,7 +104,7 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
}
|
||||
|
||||
// Open Squish files for scanning unless they are already open
|
||||
if(not isopen) {
|
||||
if(not _wasopen) {
|
||||
|
||||
data->idx = NULL;
|
||||
data->base.totalmsgs = 0;
|
||||
@ -129,6 +140,10 @@ void SquishArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
::close(data->fhsqi);
|
||||
data->fhsqi = -1;
|
||||
}
|
||||
if(ispacked()) {
|
||||
CleanUnpacked(real_path());
|
||||
}
|
||||
isopen--;
|
||||
}
|
||||
|
||||
register ulong _msgno;
|
||||
|
@ -88,7 +88,7 @@ Line* SquishArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
|
||||
AddLine (NULL, "Hexdump of Squish-style message header and text");
|
||||
AddLineF(line, "------------------------------------------------------------------------------");
|
||||
line = AddLine(line, "");
|
||||
AddLineF(line, "Msgbase : %s", path());
|
||||
AddLineF(line, "Msgbase : %s", real_path());
|
||||
AddLineF(line, "From : %-36.36s", _hdr.from);
|
||||
AddLineF(line, "To : %-36.36s", _hdr.to);
|
||||
AddLineF(line, "Subject : %-72.72s", _hdr.subj);
|
||||
|
@ -111,8 +111,8 @@ void WCatArea::raw_open() {
|
||||
|
||||
GFTRK("WCatRawOpen");
|
||||
|
||||
data->fhix = test_open(AddPath(path(), ".ix"));
|
||||
data->fhdat = test_open(AddPath(path(), ".dat"));
|
||||
data->fhix = test_open(AddPath(real_path(), ".ix"));
|
||||
data->fhdat = test_open(AddPath(real_path(), ".dat"));
|
||||
|
||||
GFTRK(NULL);
|
||||
}
|
||||
@ -178,7 +178,7 @@ void WCatArea::save_lastread() {
|
||||
|
||||
GFTRK("WCatSaveLastread");
|
||||
|
||||
int _fh = ::sopen(AddPath(path(), ".lrd"), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
|
||||
int _fh = ::sopen(AddPath(real_path(), ".lrd"), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
|
||||
if(_fh != -1) {
|
||||
word _lastread = (word)Msgn->CvtReln(lastread);
|
||||
lseekset(_fh, wcatwide->userno, sizeof(word));
|
||||
|
@ -78,9 +78,20 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
wide = wcatwide;
|
||||
}
|
||||
|
||||
int _wasopen = isopen;
|
||||
if(not _wasopen) {
|
||||
if(ispacked()) {
|
||||
const char* newpath = Unpack(path());
|
||||
if(newpath == NULL)
|
||||
packed(false);
|
||||
set_real_path(newpath ? newpath : path());
|
||||
}
|
||||
isopen++;
|
||||
}
|
||||
|
||||
// Load the lastread
|
||||
dword _lastread = 0;
|
||||
int _fh = ::sopen(AddPath(path(), ".lrd"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
int _fh = ::sopen(AddPath(real_path(), ".lrd"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
if(_fh != -1) {
|
||||
lseekset(_fh, wide->userno, sizeof(dword));
|
||||
read(_fh, &_lastread, sizeof(dword));
|
||||
@ -88,7 +99,7 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
}
|
||||
|
||||
// Open WildCat! files for scanning unless they are already open
|
||||
if(not isopen) {
|
||||
if(not _wasopen) {
|
||||
|
||||
data->idx = NULL;
|
||||
data->base.recsize = 0;
|
||||
@ -96,7 +107,7 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
data->base.nextmsgno = 0;
|
||||
|
||||
// Open index file
|
||||
data->fhix = ::sopen(AddPath(path(), ".ix"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
data->fhix = ::sopen(AddPath(real_path(), ".ix"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
if(data->fhix != -1) {
|
||||
|
||||
// Allocate index buffer and read from file
|
||||
@ -106,6 +117,10 @@ void WCatArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
::close(data->fhix);
|
||||
data->fhix = -1;
|
||||
}
|
||||
if(ispacked()) {
|
||||
CleanUnpacked(real_path());
|
||||
}
|
||||
isopen--;
|
||||
}
|
||||
|
||||
register uint _active = 0;
|
||||
|
@ -45,11 +45,11 @@ void WCatArea::lock() {
|
||||
if(WideCanLock) {
|
||||
long _tries = 0;
|
||||
while(::lock(data->fhix, 0, 1) == -1) {
|
||||
if(PopupLocked(++_tries, true, path()) == false) {
|
||||
if(PopupLocked(++_tries, true, real_path()) == false) {
|
||||
WideLog->ErrLock();
|
||||
raw_close();
|
||||
WideLog->printf("! A WildCat! msgbase file could not be locked.");
|
||||
WideLog->printf(": %s.IX.", path());
|
||||
WideLog->printf(": %s.ix.", real_path());
|
||||
WideLog->ErrOSInfo();
|
||||
LockErrorExit();
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ Line* WCatArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
|
||||
AddLine (NULL, "Hexdump of WildCat! message header and text");
|
||||
AddLineF(line, "------------------------------------------------------------------------------");
|
||||
line = AddLine(line, "");
|
||||
AddLineF(line, "Path : %s", path());
|
||||
AddLineF(line, "Path : %s", real_path());
|
||||
AddLineF(line, "MagicNumber: %08lXh", _hdr.magicnumber);
|
||||
AddLineF(line, "MsgNumber : %u", _hdr.msgno);
|
||||
AddLineF(line, "Orig : %s", STRNP2C(_hdr.from));
|
||||
|
@ -124,9 +124,9 @@ void XbbsArea::raw_open() {
|
||||
|
||||
GFTRK("XbbsRawOpen");
|
||||
|
||||
data->fhdata = test_open(AddPath(path(), ".Data"));
|
||||
data->fhindex = test_open(AddPath(path(), ".Index"));
|
||||
data->fhtext = test_open(AddPath(path(), ".Text"));
|
||||
data->fhdata = test_open(AddPath(real_path(), ".Data"));
|
||||
data->fhindex = test_open(AddPath(real_path(), ".Index"));
|
||||
data->fhtext = test_open(AddPath(real_path(), ".Text"));
|
||||
wide->isopen++;
|
||||
if(wide->isopen == 1)
|
||||
wide->user->fh = ::sopen(AddPath(wide->path, "Users"), O_RDONLY|O_BINARY, WideSharemode, S_STDRW);
|
||||
@ -222,7 +222,7 @@ void XbbsArea::save_lastread() {
|
||||
|
||||
GFTRK("XbbsSaveLastread");
|
||||
|
||||
int _fh = ::sopen(AddPath(path(), ".lmr"), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
|
||||
int _fh = ::sopen(AddPath(real_path(), ".lmr"), O_RDWR|O_CREAT|O_BINARY, WideSharemode, S_STDRW);
|
||||
if(_fh != -1) {
|
||||
ulong _lastread = Msgn->CvtReln(lastread);
|
||||
lseekset(_fh, wide->userno+1, sizeof(ulong));
|
||||
|
@ -88,9 +88,20 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
wide = xbbswide;
|
||||
}
|
||||
|
||||
int _wasopen = isopen;
|
||||
if(not _wasopen) {
|
||||
if(ispacked()) {
|
||||
const char* newpath = Unpack(path());
|
||||
if(newpath == NULL)
|
||||
packed(false);
|
||||
set_real_path(newpath ? newpath : path());
|
||||
}
|
||||
isopen++;
|
||||
}
|
||||
|
||||
// Load the lastread
|
||||
ulong _lastread = 0;
|
||||
int _fh = ::sopen(AddPath(path(), ".lmr"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
int _fh = ::sopen(AddPath(real_path(), ".lmr"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
if(_fh != -1) {
|
||||
lseekset(_fh, wide->userno+1, sizeof(ulong));
|
||||
read(_fh, &_lastread, sizeof(ulong));
|
||||
@ -98,13 +109,13 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
}
|
||||
|
||||
// Open AdeptXBBS files for scanning unless they are already open
|
||||
if(not isopen) {
|
||||
if(not _wasopen) {
|
||||
|
||||
data->idx = NULL;
|
||||
data->idx_size = 0;
|
||||
|
||||
// Open index file
|
||||
data->fhindex = ::sopen(AddPath(path(), ".Index"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
data->fhindex = ::sopen(AddPath(real_path(), ".Index"), O_RDONLY|O_BINARY, WideSharemode, S_STDRD);
|
||||
if(data->fhindex != -1) {
|
||||
|
||||
// Allocate index buffer and read from file
|
||||
@ -114,6 +125,10 @@ void XbbsArea::raw_scan(int __keep_index, int __scanpm) {
|
||||
::close(data->fhindex);
|
||||
data->fhindex = -1;
|
||||
}
|
||||
if(ispacked()) {
|
||||
CleanUnpacked(real_path());
|
||||
}
|
||||
isopen--;
|
||||
}
|
||||
|
||||
register uint _active = 0;
|
||||
|
@ -61,11 +61,11 @@ void XbbsArea::lock_file(int handle, long position, long length) {
|
||||
|
||||
long tries = 0;
|
||||
while(::lock(handle, position, length) == -1) {
|
||||
if(PopupLocked(++tries, true, path()) == false) {
|
||||
if(PopupLocked(++tries, true, real_path()) == false) {
|
||||
WideLog->ErrLock();
|
||||
raw_close();
|
||||
Path file;
|
||||
strcpy(file, path());
|
||||
strcpy(file, real_path());
|
||||
if(handle == data->fhdata)
|
||||
strcat(file, ".Data");
|
||||
else if(handle == data->fhtext)
|
||||
|
@ -70,7 +70,7 @@ Line* XbbsArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
|
||||
AddLine (NULL, "Hexdump of AdeptXBBS message header and text");
|
||||
AddLineF(line, "------------------------------------------------------------------------------");
|
||||
line = AddLine(line, "");
|
||||
AddLineF(line, "Path : %s", path());
|
||||
AddLineF(line, "Path : %s", real_path());
|
||||
AddLineF(line, "UserRecno : %u (%s)", wide->userno, WideUsername[0]);
|
||||
line = AddLine(line, "");
|
||||
AddLineF(line, "Header Record:");
|
||||
|
Reference in New Issue
Block a user