Skip to content
Snippets Groups Projects
Commit b830d5f5 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix ERROR ... removing file from database

Wrong arguments passed to loadfiles() caused only index to be read.

As reported by plt via irc:
ERROR (smb_putmsghdr illegal header length increase: 70 (1 blocks, 0 hfields, 0 dfields) vs 0 (0 blocks)) removing file from database

Also, replace old CVS rev with Git branch and hash.

And for everyone: use delfiles.js instead (e.g. with jsexec).
parent fc6a8fa6
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include "str_util.h" #include "str_util.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h> #include <stdbool.h>
#include "git_branch.h"
#include "git_hash.h"
#define DELFILES_VER "3.19" #define DELFILES_VER "3.19"
...@@ -89,7 +91,6 @@ bool delfile(const char *filename) ...@@ -89,7 +91,6 @@ bool delfile(const char *filename)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
char revision[16];
char str[256],not[MAX_NOTS][LEN_EXTCODE + 1],nots=0,*p; char str[256],not[MAX_NOTS][LEN_EXTCODE + 1],nots=0,*p;
char fpath[MAX_PATH+1]; char fpath[MAX_PATH+1];
int i,j,dirnum,libnum; int i,j,dirnum,libnum;
...@@ -101,10 +102,8 @@ int main(int argc, char **argv) ...@@ -101,10 +102,8 @@ int main(int argc, char **argv)
setvbuf(stdout,NULL,_IONBF,0); setvbuf(stdout,NULL,_IONBF,0);
sscanf("$Revision: 1.54 $", "%*s %s", revision); fprintf(stderr,"\nDELFILES Version %s-%s %s/%s - Removes files from Synchronet "
"Filebase\n" ,DELFILES_VER, PLATFORM_DESC, GIT_BRANCH, GIT_HASH);
fprintf(stderr,"\nDELFILES Version %s-%s (rev %s) - Removes files from Synchronet "
"Filebase\n" ,DELFILES_VER, PLATFORM_DESC, revision);
if(argc<2) { if(argc<2) {
printf("\n usage: %s <dir_code or * for ALL> [switches]\n", argv[0]); printf("\n usage: %s <dir_code or * for ALL> [switches]\n", argv[0]);
...@@ -243,7 +242,7 @@ int main(int argc, char **argv) ...@@ -243,7 +242,7 @@ int main(int argc, char **argv)
printf("\nScanning %s %s\n", cfg.lib[cfg.dir[i]->lib]->sname, cfg.dir[i]->lname); printf("\nScanning %s %s\n", cfg.lib[cfg.dir[i]->lib]->sname, cfg.dir[i]->lname);
size_t file_count; size_t file_count;
file_t* file_list = loadfiles(&smb, NULL, 0, /* extdesc: */FALSE, FILE_SORT_NATURAL, &file_count); file_t* file_list = loadfiles(&smb, NULL, /* since: */0, file_detail_normal, FILE_SORT_NATURAL, &file_count);
for(fi = 0; fi < file_count; fi++) { for(fi = 0; fi < file_count; fi++) {
file_t* f = &file_list[fi]; file_t* f = &file_list[fi];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment