diff options
author | Jeremy Allison <jra@samba.org> | 2000-03-10 22:25:02 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-03-10 22:25:02 +0000 |
commit | d56e3425a1a00f6f4de770967d34680ebebc286e (patch) | |
tree | f924d8f5cc8ddc7e5c970991c1a9d93a0a07e440 /source3/client | |
parent | 5e22394654eba2ed5d01e81b165a044a59dd65ab (diff) | |
download | samba-d56e3425a1a00f6f4de770967d34680ebebc286e.tar.gz samba-d56e3425a1a00f6f4de770967d34680ebebc286e.tar.bz2 samba-d56e3425a1a00f6f4de770967d34680ebebc286e.zip |
Fix for names with spaces and some I18N filename issues from
V. Fyodorov <V.Fyodorov@VAZ.RU>.
Jeremy.
(This used to be commit 4673aa1a4b133338715059174813b8e29d093972)
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/client.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index ea029d4df7..08dd8970fc 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -815,14 +815,14 @@ static void do_mget(file_info *finfo) if (lowercase) strlower(finfo->name); - if (!dos_directory_exist(finfo->name,NULL) && - dos_mkdir(finfo->name,0777) != 0) { + if (!directory_exist(finfo->name,NULL) && + mkdir(finfo->name,0777) != 0) { DEBUG(0,("failed to create directory %s\n",finfo->name)); pstrcpy(cur_dir,saved_curdir); return; } - if (dos_chdir(finfo->name) != 0) { + if (chdir(finfo->name) != 0) { DEBUG(0,("failed to chdir to directory %s\n",finfo->name)); pstrcpy(cur_dir,saved_curdir); return; @@ -1120,8 +1120,8 @@ static BOOL seek_list(FILE *f,char *name) { pstring s; while (!feof(f)) { - if (fscanf(f,"%s",s) != 1) return(False); - trim_string(s,"./",NULL); + if (!fgets(s,sizeof(s),f)) return(False); + trim_string(s,"./","\n"); if (strncmp(s,name,strlen(name)) != 0) { pstrcpy(name,s); return(True); @@ -1162,10 +1162,10 @@ static void cmd_mput(void) "%s/ls.smb.%d",tmpdir(),(int)getpid()); if (recurse) slprintf(cmd,sizeof(pstring)-1, - "find . -name \"%s\" -print > %s",p,tmpname); + "find . -name \"%s\" -print > %s",p,tmpname); else slprintf(cmd,sizeof(pstring)-1, - "/bin/ls %s > %s",p,tmpname); + "find . -maxdepth 1 -name \"%s\" -print > %s",p,tmpname); system(cmd); f = sys_fopen(tmpname,"r"); @@ -1174,8 +1174,8 @@ static void cmd_mput(void) while (!feof(f)) { pstring quest; - if (fscanf(f,"%s",lname) != 1) break; - trim_string(lname,"./",NULL); + if (!fgets(lname,sizeof(lname),f)) break; + trim_string(lname,"./","\n"); again1: @@ -1193,6 +1193,7 @@ static void cmd_mput(void) pstrcpy(rname,cur_dir); pstrcat(rname,lname); + dos_format(rname); if (!cli_chkpath(cli, rname) && !do_mkdir(rname)) { pstrcat(lname,"/"); if (!seek_list(f,lname)) @@ -1424,7 +1425,7 @@ static void cmd_newer(void) SMB_STRUCT_STAT sbuf; ok = next_token(NULL,buf,NULL,sizeof(buf)); - if (ok && (dos_stat(buf,&sbuf) == 0)) { + if (ok && (sys_stat(buf,&sbuf) == 0)) { newer_than = sbuf.st_mtime; DEBUG(1,("Getting files newer than %s", asctime(LocalTime(&newer_than)))); |