diff options
-rw-r--r-- | source3/client/client.c | 11 | ||||
-rw-r--r-- | source3/include/client.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 61c4c8e4be..e2b3486990 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -514,6 +514,14 @@ static int do_list_queue_empty(void) static void do_list_helper(const char *mntpoint, file_info *f, const char *mask, void *state) { + char *dir_end; + + /* save the directory */ + pstrcpy( f->dir, mask ); + if ( (dir_end = strrchr( f->dir, '\\' )) != NULL ) { + *dir_end = '\0'; + } + if (f->mode & aDIR) { if (do_list_dirs && do_this_one(f)) { do_list_fn(f); @@ -1613,8 +1621,7 @@ static void do_del(file_info *finfo) { pstring mask; - pstrcpy(mask,cur_dir); - pstrcat(mask,finfo->name); + pstr_sprintf( mask, "%s\\%s", finfo->dir, finfo->name ); if (finfo->mode & aDIR) return; diff --git a/source3/include/client.h b/source3/include/client.h index df52e227f0..30e0fae874 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -44,6 +44,7 @@ typedef struct file_info time_t atime; time_t ctime; pstring name; + pstring dir; char short_name[13*3]; /* the *3 is to cope with multi-byte */ } file_info; |