Commit 415c9d79 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

When adding one file at a time, the description is now optional.

If no description is given, just make the default/short description, literally, "No description given" - rather than refusing to add the file.
parent 523d7e80
Pipeline #921 passed with stage
in 16 minutes and 55 seconds
......@@ -29,7 +29,7 @@
#include <stdbool.h>
#include <stdarg.h>
#define ADDFILES_VER "3.04"
#define ADDFILES_VER "3.05"
scfg_t scfg;
......@@ -665,7 +665,7 @@ void synclist(char *inpath, int dirnum)
char *usage="\nusage: addfiles code [.alt_path] [-opts] +list "
"[desc_off] [size_off]"
"\n or: addfiles code [.alt_path] [-opts] file "
"\navailable opts:"
"\n -a import ASCII only (no extended ASCII)"
"\n -b synchronize database with file list (use with caution)"
......@@ -898,7 +898,7 @@ int main(int argc, char **argv)
if(j+1==argc) {
printf("%s no description given.\n",;
SAFECOPY(f.desc, "no description given");
sprintf(str,"%s%s",cur_altpath ? scfg.altpath[cur_altpath-1]
: scfg.dir[f.dir]->path,argv[j]);
......@@ -922,8 +922,10 @@ int main(int argc, char **argv)
SAFECOPY(f.desc, unixtodstr(&scfg,(time32_t)file_timestamp,tmp));
SAFECAT(f.desc, " ");
SAFECAT(f.desc, argv[j]);
if(j+1 < argc) {
SAFECAT(f.desc, argv[j]);
if(l==-1) {
printf("%s not found.\n",str);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment