Fixed some other smal bugs with mbfile import

This commit is contained in:
Michiel Broek 2005-01-02 15:11:07 +00:00
parent a91c5a1913
commit c9c4773a32
2 changed files with 10 additions and 7 deletions

View File

@ -40,6 +40,9 @@ v0.71.1 28-Nov-2004
8.3 and long filenames and does the right thing during import.
During file import the destination is tested for both 8.3 and
LFN for an existing file. Improved error reporting.
With mbfile import the original file isn't renamed anymore.
Fixed error reporting when files in files.bbs were not found
on disk.
mbfido:
In rfc2ftn a debug logmessage added to check for unrecognised

View File

@ -45,7 +45,7 @@ extern int do_novir; /* Suppress virus scanning */
void ImportFiles(int Area)
{
char *pwd, *temp, *temp2, *tmpdir, *String, *token, *dest, *unarc, *lname;
char *pwd, *temp, *fod, *temp2, *tmpdir, *String, *token, *dest, *unarc, *lname;
FILE *fbbs;
DIR *dp;
int Append = FALSE, Files = 0, rc, i, line = 0, pos, x, y, Doit;
@ -81,6 +81,7 @@ void ImportFiles(int Area)
String = calloc(4096, sizeof(char));
dest = calloc(PATH_MAX, sizeof(char));
lname = calloc(PATH_MAX, sizeof(char));
fod = calloc(PATH_MAX, sizeof(char));
getcwd(pwd, PATH_MAX);
if (CheckFDB(Area, area.Path))
@ -215,15 +216,16 @@ void ImportFiles(int Area)
closedir(dp);
if (strlen(temp2) == 0) {
WriteError("Can't find file on disk, skipping: %s", temp2);
WriteError("Can't find file on disk, skipping: %s", token);
if (!do_quiet)
printf("\nCan't find file on disk, skipping: %s\n", temp2);
printf("\nCan't find file on disk, skipping: %s\n", token);
Append = FALSE;
Present = FALSE;
} else {
/*
* Check type of filename and set the right values.
*/
strcpy(fod, temp2);
if (is_real_8_3(temp2)) {
Syslog('f', "%s is 8.3", temp2);
strcpy(f_db.Name, temp2);
@ -234,12 +236,9 @@ void ImportFiles(int Area)
strcpy(f_db.LName, temp2);
name_mangle(temp2);
strcpy(f_db.Name, temp2);
if (strcmp(f_db.LName, f_db.Name) && (rename(f_db.LName, f_db.Name) == 0)) {
Syslog('+', "Renamed %s to %s", f_db.LName, f_db.Name);
}
}
sprintf(temp, "%s/%s", pwd, f_db.Name);
sprintf(temp, "%s/%s", pwd, fod);
stat(temp, &statfile);
if (do_annon)
@ -433,6 +432,7 @@ void ImportFiles(int Area)
}
}
free(fod);
free(lname);
free(dest);
free(String);