Skip to content
Snippets Groups Projects
Commit ac85a6c1 authored by rswindell's avatar rswindell
Browse files

Couple bug fixes and more debug output.

parent f07966cb
No related branches found
No related tags found
No related merge requests found
......@@ -209,8 +209,10 @@ for(var l in list_array) {
/* Get export message pointer */
ptr_fname = list.msgbase_file + ".list.ptr";
if(!file_exists(ptr_fname))
file_touch(ptr_fname);
ptr_file = new File(ptr_fname);
if(!ptr_file.open("w+")) {
if(!ptr_file.open("r+")) {
log(LOG_ERR,format("%s !ERROR %d opening/creating file: %s"
,list.name, ptr_file.error, ptr_fname));
delete msgbase;
......@@ -220,6 +222,9 @@ for(var l in list_array) {
var last_msg = msgbase.last_msg;
var ptr = Number(ptr_file.readln());
log(LOG_DEBUG,format("%s pointer read: %u"
,list.name, ptr));
if(ptr < msgbase.first_msg)
ptr = msgbase.first_msg;
else
......@@ -298,6 +303,9 @@ for(var l in list_array) {
if(ptr > last_msg)
ptr = last_msg;
log(LOG_DEBUG,format("%s pointer written: %u"
,list.name, ptr));
ptr_file.rewind();
ptr_file.length=0; // truncate
ptr_file.writeln(ptr);
......@@ -384,7 +392,7 @@ function read_user_list(user_file)
function get_user_list(list)
{
var user_list = new Array();
if((user_file = open_user_list("r")) != null) {
if((user_file = open_user_list(list,"r")) != null) {
user_list = read_user_list(user_file);
user_file.close();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment