Author: kalim
Date: 2005-08-28 22:00:28 +0000 (Sun, 28 Aug 2005)
New Revision: 9716

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9716

Log:
Now using the correct mode variable in mget.
Fixed up recursion/directory handling in mget.

-Kalim
Modified:
   branches/SOC/SAMBA_3_0/source/client/client.c


Changeset:
Modified: branches/SOC/SAMBA_3_0/source/client/client.c
===================================================================
--- branches/SOC/SAMBA_3_0/source/client/client.c       2005-08-28 21:46:46 UTC 
(rev 9715)
+++ branches/SOC/SAMBA_3_0/source/client/client.c       2005-08-28 22:00:28 UTC 
(rev 9716)
@@ -666,7 +666,7 @@
             {
                 if (smbc_stat(dentname, &stat) < 0)
                 {
-                    d_printf("> %s - error: %s\n", dent->name, 
strerror(errno));
+                    d_printf("> %s - stat error: %s\n", dent->name, 
strerror(errno));
                 }
                 else
                 {
@@ -1047,7 +1047,7 @@
        if (strequal(name,".") || strequal(name,".."))
                return;
 
-    if (S_ISDIR(mode))
+    if (S_ISDIR(st->st_mode))
                slprintf(quest,sizeof(pstring)-1, "Get directory %s%s? ", 
cur_dir, name);
        else
                slprintf(quest,sizeof(pstring)-1, "Get file %s%s? ", cur_dir, 
name);
@@ -1055,7 +1055,7 @@
        if (prompt && !yesno(quest))
                return;
 
-       if (!S_ISDIR(mode)) {
+       if (!S_ISDIR(st->st_mode)) {
         pstrcpy(rname,"smb:");
         pstrcat(rname,service);
                pstrcat(rname,cur_dir);
@@ -1066,7 +1066,7 @@
 
        /* handle directories */
     /* TODO: clean this code up for recursive calls */
-       /*pstrcpy(saved_curdir,cur_dir);
+       pstrcpy(saved_curdir,cur_dir);
 
        pstrcat(cur_dir,name);
        pstrcat(cur_dir,"/");
@@ -1088,12 +1088,15 @@
                return;
        }
 
-       pstrcpy(mget_mask,cur_dir);
+    pstrcpy(mget_mask,"smb:");
+    pstrcat(mget_mask,service);
+       pstrcat(mget_mask,cur_dir);
        pstrcat(mget_mask,"*");
        
-       tool_list(mget_mask, mode, do_mget, False, True);
+    /*d_printf("Calling with mask: %s\n", mget_mask);*/
+       tool_list(mget_mask, mode, do_mget, recurse, recurse);
        chdir("..");
-       pstrcpy(cur_dir,saved_curdir);*/
+       pstrcpy(cur_dir,saved_curdir);
 }
 
 /****************************************************************************
@@ -1167,7 +1170,7 @@
                        pstrcat(mget_mask,p);
         /* TODO: enable directories on calls to tool_list
            once recursion is worked out */
-               tool_list(mget_mask, mode, do_mget, recurse, False);
+               tool_list(mget_mask, mode, do_mget, recurse, recurse);
        }
 
        if (!*mget_mask) {
@@ -1177,7 +1180,7 @@
                if(mget_mask[strlen(mget_mask)-1]!='/')
                        pstrcat(mget_mask,"/");
                pstrcat(mget_mask,"*");
-               tool_list(mget_mask, mode, do_mget, recurse, False);
+               tool_list(mget_mask, mode, do_mget, recurse, recurse);
        }
        
        return 0;

Reply via email to