Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
stsaz committed Mar 1, 2025
1 parent 229e119 commit d1fa5c9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/fcom.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#undef stdin
#undef stdout

#define FCOM_VER "1.0-rc18"
#define FCOM_CORE_VER 10018
#define FCOM_VER "1.0-rc19"
#define FCOM_CORE_VER 10019

typedef unsigned char byte;
typedef unsigned char u_char;
Expand Down
9 changes: 5 additions & 4 deletions src/fs/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ Usage:\n\
\n\
OPTIONS:\n\
`-u`, `--unbranch` Move and rename a file out of its directory structure, e.g.\n\
fcom move --unbranch ./a\n\
`fcom move --unbranch ./a`\n\
moves/renames \"./a/b/file\" -> \"./a - b - file\"\n\
`--unbranch-flat` Move a file out of its directory structure, e.g.\n\
fcom move --unbranch-flat ./a\n\
`-uf`, `--unbranch-flat` Move a file out of its directory structure, e.g.\n\
`fcom move --unbranch-flat ./a`\n\
moves \"./a/b/file\" -> \"./file\"\n\
`-s`, `--search` 'SEARCH'\n\
`-r`, `--replace` 'REPLACE'\n\
Replace SEARCH text in file name with REPLACE\n\
`--replace-once` Replace only the first occurrence\n\
`-t`, `--tree` Preserve directory tree, e.g.\n\
fcom move --tree a/b/c -C out\n\
`fcom move --tree a/b/c -C out`\n\
moves \"a/b/c\" to \"out/a/b/c\"\n\
`-k`, `--skip-errors` Don't fail on error\n\
";
Expand Down Expand Up @@ -210,6 +210,7 @@ static int args_parse(struct move *m, fcom_cominfo *cmd)
{ "-s", 'S', O(search) },
{ "-t", '1', O(tree) },
{ "-u", '1', O(unbranch) },
{ "-uf", '1', O(unbranch_flat) },
{}
};
if (0 != core->com->args_parse(cmd, args, m, FCOM_COM_AP_INOUT))
Expand Down
4 changes: 2 additions & 2 deletions src/fs/sync-cmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ struct diff {
r = _fntr_ent_first(right->root)->children;

fntree_cmp_init(&this->fcmp, l, r, data_cmp, this);
ffvec_allocT(&this->ents, left->total + right->total + 2, fntree_cmp_ent);
ffvec_allocT(&this->ents, left->total + right->total, fntree_cmp_ent);
this->stats.ltotal = left->total;
this->stats.rtotal = right->total;
}
Expand All @@ -239,7 +239,7 @@ struct diff {
le = NULL, lb = NULL; break;
}

FF_ASSERT(ents.len < ents.cap);
FF_ASSERT(this->ents.len < this->ents.cap);
fntree_cmp_ent *ce = ffvec_pushT(&this->ents, fntree_cmp_ent);
ce->status = 0;
ce->l = le;
Expand Down
2 changes: 2 additions & 0 deletions src/fs/sync-scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,14 @@ static void sync_combine(struct snapshot *s, fntree_entry *e2)

s->root = newroot;
s->root_dir.len = parent.len;
s->total += 3;

} else {
// 2.
fntree_block **root = &_fntr_ent_first(s->root)->children;
fntree_entry *e = fntree_add(root, name2, data_len);
fntree_entry_set(e, e2, data_len);
s->total++;
}

e2->children = NULL;
Expand Down

0 comments on commit d1fa5c9

Please sign in to comment.