r10964: BUG 1051: store the directory path so we can send the full name in the unlink...
authorGerald Carter <jerry@samba.org>
Thu, 13 Oct 2005 15:51:25 +0000 (15:51 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:04:58 +0000 (11:04 -0500)
source/client/client.c
source/include/client.h

index 61c4c8e4beb2bc9c382da6e77603998b8409f1d4..e2b348699074a961c44341a337f7f4ca085509c7 100644 (file)
@@ -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;
index df52e227f0c55d611bf89eec96f1b7216e9dd759..30e0fae87441ad1f449ed5a2862f7b9c363a8dcf 100644 (file)
@@ -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;