If the download.int_unsort file doesn't exist, the sort command fails and sarg
abort the process.
With this patch, it simply continues the processing optionaly printing an
information message.
Now, it is an error if the sorted file doesn't exists. In previous versions, it
was just a warning.
struct userinfostruct *uinfo;
struct tm t;
+ if (!ndownload) {
+ if (debugz) debugaz(_("No downloaded files to report\n"));
+ return;
+ }
+
ouser[0]='\0';
ouser2[0]='\0';
snprintf(report_in,sizeof(report_in),"%s/download.int_log",tmp);
download_sort(report_in);
if(access(report_in, R_OK) != 0) {
- if (debugz) debugaz(_("Downloaded files report not generated as it is empty\n"));
- return;
+ debugaz(_("Sorted file doesn't exist (to produce the download report)\n"));
+ exit(EXIT_FAILURE);
}
// produce the report.