diff options
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); } |