summaryrefslogtreecommitdiff
path: root/buff.c
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2018-07-16 11:23:36 +0100
committerKatolaZ <katolaz@freaknet.org>2018-07-16 11:23:36 +0100
commitd3d5d96e6c17a4eaf409212b806e4d6a9d04f6c5 (patch)
treefc3030a0dd489770f960926a38e3f816d4408fd6 /buff.c
parent973479aa7fc254b887aed5fe6a57935648ee883c (diff)
exec halfaway throughHEADmaster
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");
+
+}