summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/main.c b/main.c
index 8567596..00294cf 100644
--- a/main.c
+++ b/main.c
@@ -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);
}