summaryrefslogtreecommitdiff
path: root/buff.c
diff options
context:
space:
mode:
Diffstat (limited to 'buff.c')
-rw-r--r--buff.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/buff.c b/buff.c
index fde4448..b5922a5 100644
--- a/buff.c
+++ b/buff.c
@@ -297,7 +297,7 @@ int write_lines(char app){
l = l->next;
}
fclose(fout);
- printf("%d\n", tot);
+ fprintf(stderr, "%d\n", tot);
return 0;
}
@@ -389,3 +389,19 @@ void transfer_lines(int addr, char move){
move_to_line(addr+n,0);
mod = 1;
}
+
+
+void exec_command(char *s, FILE *fout){
+
+ char buff[4096];
+ FILE *fin;
+
+ fin = popen(s, "r");
+ while(feof(fin) == 0){
+ if (!fgets(buff, 4095, fin)) break;
+ fputs(buff, fout);
+ }
+ pclose(fin);
+ printf("!\n");
+
+}