diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -175,7 +175,7 @@ int get_fname(char **cmd){ void main_loop(){ char *cmd, *c; - int ret; + int ret, addr, tmp1, tmp2; char p, move; cmd = malloc(256 * sizeof(char)); @@ -295,14 +295,21 @@ void main_loop(){ case 'm': move = 1; case 't': cmd +=1; + if (ret <2) + addr2 = addr1; CHECKADDR; - if (get_addr((const char**)&cmd) == 1) - transfer_lines(addr1, move); + tmp1=addr1, tmp2=addr2; + if(get_addr((const char**)&cmd) == 1){ + addr = addr1; + addr1 = tmp1, addr2 = tmp2; + transfer_lines(addr, move); + } else E; + move = 0; break; case 'w': - cmd +=1; + cmd += 1; get_fname(&cmd); if (!fname) E; |