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 /buff.c | |
parent | 973479aa7fc254b887aed5fe6a57935648ee883c (diff) |
Diffstat (limited to 'buff.c')
-rw-r--r-- | buff.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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"); + +} |