Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
utils: fix deferred_unlink (reggresion from 1ffad11), fixes #3143
  • Loading branch information
perexg committed Oct 11, 2015
1 parent ea02889 commit 6769c0e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils.c
Expand Up @@ -699,7 +699,7 @@ int
deferred_unlink(const char *filename, const char *rootdir)
{
deferred_unlink_t *du;
char *s;
char *s, *p;
size_t l;
int r;
long max;
Expand All @@ -711,7 +711,9 @@ deferred_unlink(const char *filename, const char *rootdir)
max = pathconf(filename, _PC_NAME_MAX);
strcpy(s, filename);
if (l + 10 < max) {
s[0] = '.';
p = strrchr(s, '/');
if (p && p[1])
p[1] = '.';
strcpy(s + l, ".removing");
} else {
memcpy(s, ".rm.", 4);
Expand Down

0 comments on commit 6769c0e

Please sign in to comment.