diff options
author | KatolaZ <[email protected]> | 2018-07-16 11:23:36 +0100 |
---|---|---|
committer | KatolaZ <[email protected]> | 2018-07-16 11:23:36 +0100 |
commit | d3d5d96e6c17a4eaf409212b806e4d6a9d04f6c5 (patch) | |
tree | fc3030a0dd489770f960926a38e3f816d4408fd6 /main.c | |
parent | 973479aa7fc254b887aed5fe6a57935648ee883c (diff) |
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -27,7 +27,7 @@ const char* skip_blank(const char **c){ int get_addr(const char **cmd){ - int addr, n, got; + int addr, n, got, d; char sign = 1, comma = 0, semic = 0, DIR = FW; const char *c; line_t *p; @@ -86,6 +86,11 @@ int get_addr(const char **cmd){ case '\'': /* mark */ fprintf(stderr, " >>>> address is a mark!!!\n"); c++; + d = *c - 'a'; + if (d < 0 || d > 26){ + E; + return -1; + } p = marks[*c - 'a']; if (!p) E; @@ -347,7 +352,10 @@ void main_loop(){ break; case '!': cmd += 1; - //exec_command(); + system(cmd); + printf("!\n"); + /* exec_command(cmd, stdout); */ + break; case '=': if (addr1 == -1) addr1 = num; @@ -385,7 +393,7 @@ int main(int argc, char *argv[]){ } main_loop(); addr1 = num, addr2 = 1; - delete_lines(); + if (num>0) delete_lines(); free(fname); } |