diff --git a/programs/network/ftpc/ftpc.asm b/programs/network/ftpc/ftpc.asm index 2abea12494..2ba076bf57 100644 --- a/programs/network/ftpc/ftpc.asm +++ b/programs/network/ftpc/ftpc.asm @@ -222,6 +222,9 @@ wait_for_usercommand: cmp dword[s], "bye" + 10 shl 24 je cmd_bye + cmp dword[s], "lcwd" + je cmd_lcwd + invoke con_write_asciiz, str_unknown jmp wait_for_usercommand @@ -311,6 +314,7 @@ str12 db 'Waiting for welcome message.',10,0 str_user db "username: ",0 str_pass db "password: ",0 str_unknown db "unknown command",10,0 +str_lcwd db "local working directory is now: ",0 str_help db "available commands:",10 db "help - help",10,10 @@ -318,6 +322,7 @@ str_help db "available commands:",10 db "cwd - change working directoy on server",10 db "dele - delete file from server",10 db "list - list files and folders in current directory",10 + db "lcwd - change local working directory",10 db "pwd - print working directory",10 db "retr - retreive file from server",10 db "stor - store file on server",10 diff --git a/programs/network/ftpc/usercommands.inc b/programs/network/ftpc/usercommands.inc index 507458187c..9e8870dd53 100644 --- a/programs/network/ftpc/usercommands.inc +++ b/programs/network/ftpc/usercommands.inc @@ -127,6 +127,29 @@ cmd_stor: jmp wait_for_servercommand +cmd_lcwd: + + mov esi, s+5 + mov ecx, 256-5 + .loop: + lodsb + cmp al, 10 + je .done + test al, al + je .done + loop .loop + .done: + mov byte[esi-1], 0 + mcall 30, 1, s+5 ; set working directory + mcall 30, 2, s, 256 ; and read it again + + invoke con_write_asciiz, str_lcwd + invoke con_write_asciiz, s + invoke con_write_asciiz, str4 ; newline + + jmp wait_for_usercommand + + ; esi = source ptr ; edi = dest ptr