Fixed file importing of non-archived files

This commit is contained in:
Michiel Broek 2005-12-16 19:52:20 +00:00
parent 0d78dc25e1
commit 1e1caf43d1
2 changed files with 11 additions and 3 deletions

View File

@ -2,6 +2,9 @@ $Id$
v0.83.4 04-Dec-2005 v0.83.4 04-Dec-2005
mbfile:
Fixed file importing of non-archived files.
mbtask: mbtask:
Experimental code to recover from a half dead chatlink. Experimental code to recover from a half dead chatlink.
Added some protection against looped configuration. Added some protection against looped configuration.

View File

@ -125,7 +125,7 @@ void ImportFiles(int Area)
Syslog('+', "Unknown archive format %s", temp); Syslog('+', "Unknown archive format %s", temp);
snprintf(temp2, PATH_MAX, "%s/tmp/arc%d/%s", getenv("MBSE_ROOT"), (int)getpid(), f_db.Name); snprintf(temp2, PATH_MAX, "%s/tmp/arc%d/%s", getenv("MBSE_ROOT"), (int)getpid(), f_db.Name);
if ((rc = file_cp(temp, temp2))) { if ((rc = file_cp(temp, temp2))) {
WriteError("Can't copy file to %s, %s", temp2, strerror(rc)); WriteError("1 Can't copy file to %s, %s", temp2, strerror(rc));
if (!do_quiet) if (!do_quiet)
printf("Can't copy file to %s, %s\n", temp2, strerror(rc)); printf("Can't copy file to %s, %s\n", temp2, strerror(rc));
Doit = FALSE; Doit = FALSE;
@ -159,7 +159,6 @@ void ImportFiles(int Area)
Doit = FALSE; Doit = FALSE;
} }
} }
clean_tmpwork();
if (Doit) { if (Doit) {
if (!do_quiet) { if (!do_quiet) {
printf("Adding \b\b\b\b\b\b\b\b\b\b"); printf("Adding \b\b\b\b\b\b\b\b\b\b");
@ -193,6 +192,12 @@ void ImportFiles(int Area)
if (enoughspace(CFG.freespace) == 0) if (enoughspace(CFG.freespace) == 0)
die(MBERR_DISK_FULL); die(MBERR_DISK_FULL);
/*
* Refresh tmpwork
*/
clean_tmpwork();
create_tmpwork();
Files++; Files++;
memset(&f_db, 0, sizeof(f_db)); memset(&f_db, 0, sizeof(f_db));
Present = TRUE; Present = TRUE;
@ -414,7 +419,6 @@ void ImportFiles(int Area)
Doit = FALSE; Doit = FALSE;
} }
} }
clean_tmpwork();
if (Doit) { if (Doit) {
if (!do_quiet) { if (!do_quiet) {
printf("Adding \b\b\b\b\b\b\b\b\b\b"); printf("Adding \b\b\b\b\b\b\b\b\b\b");
@ -436,6 +440,7 @@ void ImportFiles(int Area)
} }
} }
clean_tmpwork();
free(fod); free(fod);
free(lname); free(lname);
free(dest); free(dest);