summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorKatolaZ <[email protected]>2018-05-30 16:42:16 +0100
committerKatolaZ <[email protected]>2018-05-30 16:42:16 +0100
commit00d893c8f8e742acc15e6675dec20c946dfb6fd7 (patch)
tree06325441928ab711afb550339c7aa837dd2ac223 /main.c
parent169cd80426f3a5e1462913f24b47e3f3ac39dbce (diff)
implemented 'm' and 't'
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/main.c b/main.c
index d22a028..eb3b5ad 100644
--- a/main.c
+++ b/main.c
@@ -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;