diff options
author | KatolaZ <katolaz@freaknet.org> | 2018-05-24 10:37:55 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2018-05-24 10:37:55 +0100 |
commit | d95e611ed47253c7cf2b170537d5aa400ffc8093 (patch) | |
tree | b0c7a0e630d037223b1c5b841feb89178714eace /main.c | |
parent | 3a10703698af22f44a44d0a1bdd5fda28e4a4712 (diff) |
Last commit before "," refactoring
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -61,7 +61,7 @@ int get_addr(const char **cmd){ addr2 = addr1; addr1 = num; break; - case ',': /* range 1 */ + case ',': /* range 1 */ /* refactor to set addr2 = addr1 */ fprintf(stderr, " >>>> comma: addr1: %d addr2: %d pos: %d\n", addr1, addr2, pos); comma = 1; if (addr1 ==-1) @@ -112,7 +112,9 @@ int get_addr(const char **cmd){ case '+': fprintf(stderr, " >>>> +/-: addr1: %d addr2: %d pos: %d\n", addr1, addr2, pos); addr2 = addr1; - addr1 = pos; + /* the assignment below breaks stuff like 1++++ */ + if (addr1 < 0) + addr1 = pos; c ++; c = skip_blank(&c); if (! isdigit(*c)){ |