From 057060feaf7395f475a32f9dad9e149ab0fa6a1c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 13 Oct 2005 15:51:25 +0000 Subject: r10964: BUG 1051: store the directory path so we can send the full name in the unlink call (del tmp\foo) (This used to be commit 49b8d7d7f5ed93a2b9b21404194452f35bcf7b26) --- source3/client/client.c | 11 +++++++++-- 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; -- cgit