From b958fdbfb3026e5383317550015eb6103014f2d1 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Mon, 22 May 2006 13:50:33 +0000 Subject: [PATCH] Fixed logging of wrong file after upload --- ChangeLog | 4 ++++ mbsebbs/filesub.c | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 877a2079..00599dcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,10 @@ v0.83.18 01-Apr-2006 Fixed a small bug. Code cleanup. + mbsebbs: + Fixed logging of wrong file after upload. + + v0.83.17 27-Mar-2006 - 01-Apr-2006 diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c index 683e2585..e7a5b680 100644 --- a/mbsebbs/filesub.c +++ b/mbsebbs/filesub.c @@ -1015,9 +1015,11 @@ int Addfile(char *File, int AreaNum, int fileid) free(Desc[i]); } - mbsedb_InsertFDB(fdb_area, fdb, area.AddAlpha); - mbsedb_CloseFDB(fdb_area); + /* + * Log upload before adding to the filebase, after insert the fdb record + * is overwritten. + */ snprintf(temp, PATH_MAX, "%s/log/uploads.log", getenv("MBSE_ROOT")); if ((pPrivate = fopen(temp, "a+")) == NULL) WriteError("$Can't open %s", temp); @@ -1035,6 +1037,9 @@ int Addfile(char *File, int AreaNum, int fileid) fclose(pPrivate); } + mbsedb_InsertFDB(fdb_area, fdb, area.AddAlpha); + mbsedb_CloseFDB(fdb_area); + Enter(1); /* Your upload time has been returned to you. Thank you for your upload! */ pout(LIGHTGREEN, BLACK, (char *) Language(288));