Don't remove trailing slash

There is no trailing slashes in the path
This commit is contained in:
Olivier Goffart 2012-12-06 16:37:11 +01:00
parent 0eb1855345
commit 5bdaf83c67

View file

@ -1126,6 +1126,7 @@ static int _csync_correct_id(CSYNC *ctx) {
c_list_t *seen_dirs = NULL; c_list_t *seen_dirs = NULL;
c_list_t *list = NULL; c_list_t *list = NULL;
c_rbtree_t *tree = NULL; c_rbtree_t *tree = NULL;
const char *replica = NULL;
char *path = NULL; char *path = NULL;
switch (ctx->current) { switch (ctx->current) {
@ -1176,7 +1177,6 @@ static int _csync_correct_id(CSYNC *ctx) {
int len; int len;
c_rbnode_t *node = NULL; c_rbnode_t *node = NULL;
char pathbuf[PATH_MAX] = {'\0' };
char *old_path = path; char *old_path = path;
csync_file_stat_t *tfs = NULL; csync_file_stat_t *tfs = NULL;
@ -1213,11 +1213,8 @@ static int _csync_correct_id(CSYNC *ctx) {
} }
} }
} }
/* get the parent dir */ /* get the parent dir */
/* copy one byte less, omit the trailing slash */ path = c_dirname( path );
strncpy( pathbuf, path, strlen(path)-1 );
/* and get the path name */
path = c_dirname( pathbuf );
/* free the old path memory */ /* free the old path memory */
SAFE_FREE(old_path ); SAFE_FREE(old_path );