Changeset 124 for branches/samba-3.0/source/client/client.c
- Timestamp:
- Mar 12, 2008, 9:08:18 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/client/client.c
r105 r124 280 280 } else { 281 281 pstrcat(cur_dir,p); 282 if ((cur_dir[0] != '\0') && (*(cur_dir+strlen(cur_dir)-1) != CLI_DIRSEP_CHAR)) { 283 pstrcat(cur_dir, CLI_DIRSEP_STR); 284 } 282 } 283 284 /* Ensure cur_dir ends in a DIRSEP */ 285 if ((cur_dir[0] != '\0') && (*(cur_dir+strlen(cur_dir)-1) != CLI_DIRSEP_CHAR)) { 286 pstrcat(cur_dir, CLI_DIRSEP_STR); 285 287 } 286 288 … … 700 702 701 703 dir_total = 0; 702 if (strcmp(cur_dir, CLI_DIRSEP_STR) != 0) { 703 pstrcpy(mask,cur_dir); 704 if ((mask[0] != '\0') && (mask[strlen(mask)-1]!=CLI_DIRSEP_CHAR)) 705 pstrcat(mask,CLI_DIRSEP_STR); 706 } else { 707 pstrcpy(mask, CLI_DIRSEP_STR); 708 } 704 pstrcpy(mask,cur_dir); 709 705 710 706 if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { 711 707 dos_format(p); 712 708 if (*p == CLI_DIRSEP_CHAR) 713 pstrcpy(mask,p + 1);709 pstrcpy(mask,p); 714 710 else 715 711 pstrcat(mask,p); … … 746 742 dir_total = 0; 747 743 pstrcpy(mask,cur_dir); 748 if ((mask[0] != '\0') && (mask[strlen(mask)-1]!=CLI_DIRSEP_CHAR)) 749 pstrcat(mask,CLI_DIRSEP_STR); 750 744 751 745 if (next_token_nr(NULL,buf,NULL,sizeof(buf))) { 752 746 dos_format(p); … … 913 907 914 908 pstrcpy(rname,cur_dir); 915 pstrcat(rname,CLI_DIRSEP_STR);916 909 917 910 p = rname + strlen(rname); … … 1008 1001 1009 1002 pstrcpy(rname,cur_dir); 1010 pstrcat(rname,CLI_DIRSEP_STR);1011 1003 1012 1004 slprintf(lname,sizeof(lname)-1, "%s/smbmore.XXXXXX",tmpdir()); … … 1057 1049 while (next_token_nr(NULL,p,NULL,sizeof(buf))) { 1058 1050 pstrcpy(mget_mask,cur_dir); 1059 if ((mget_mask[0] != '\0') && (mget_mask[strlen(mget_mask)-1]!=CLI_DIRSEP_CHAR))1060 pstrcat(mget_mask,CLI_DIRSEP_STR);1061 1051 1062 1052 if (*p == CLI_DIRSEP_CHAR) … … 1069 1059 if (!*mget_mask) { 1070 1060 pstrcpy(mget_mask,cur_dir); 1071 if(mget_mask[strlen(mget_mask)-1]!=CLI_DIRSEP_CHAR)1072 pstrcat(mget_mask,CLI_DIRSEP_STR);1073 1061 pstrcat(mget_mask,"*"); 1074 1062 do_list(mget_mask, attribute,do_mget,False,True); … … 1349 1337 1350 1338 pstrcpy(rname,cur_dir); 1351 pstrcat(rname,CLI_DIRSEP_STR);1352 1339 1353 1340 if (!next_token_nr(NULL,p,NULL,sizeof(buf))) { … … 1998 1985 *CLI_DIRSEP_STR = '/'; 1999 1986 pstrcpy(cur_dir, CLI_DIRSEP_STR); 1987 do_cd(cur_dir); 2000 1988 } 2001 1989 … … 2903 2891 2904 2892 pstrcpy(remote_name, cur_dir); 2905 pstrcat(remote_name, CLI_DIRSEP_STR);2906 2893 2907 2894 p = remote_name + strlen(remote_name); … … 2932 2919 2933 2920 pstrcpy(remote_name, cur_dir); 2934 pstrcat(remote_name, CLI_DIRSEP_STR);2935 2921 2936 2922 if (!next_token_nr(NULL, p, NULL, sizeof(buf))) { … … 3858 3844 { 3859 3845 pstring base_directory; 3846 int len = 0; 3860 3847 int opt; 3861 3848 pstring query_host; … … 3908 3895 set_global_myname( "" ); 3909 3896 3910 /* set default debug level to 0regardless of what smb.conf sets */3897 /* set default debug level to 1 regardless of what smb.conf sets */ 3911 3898 setup_logging( "smbclient", True ); 3912 3899 DEBUGLEVEL_CLASS[DBGC_ALL] = 1; … … 4069 4056 exit(1); 4070 4057 } 4058 /* Remove trailing slashes */ 4059 len = strlen(service); 4060 while(len > 0 && service[len - 1] == '\\') { 4061 --len; 4062 service[len] = '\0'; 4063 } 4071 4064 } 4072 4065
Note:
See TracChangeset
for help on using the changeset viewer.