Skip to content

Commit

Permalink
blah
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerb9 committed Jul 16, 2024
1 parent 4d8e2f9 commit c03ae48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ check: foobar all test-m100-tokenize test-m100-decomment test-m100-crunch test-

foobar: foo
./foo | xxd
xxd newline
xxd text
xxd binary
xxd binaryplus

# Check that the distribution will actually install, uninstall.
distcheck: all
Expand Down
12 changes: 10 additions & 2 deletions foo.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#include <stdio.h>
main() {
FILE *fp;
if ( fp = fopen("newline", "w") ) {
fp = stdout;
if ( fp = fopen("text", "w") ) {
fprintf(fp, "foo\nbar\n");
fprintf(fp, "foo\012bar\012");
}
if ( fp = freopen("binary", "wb", fp) ) {
fprintf(fp, "foo\nbar\n");
fprintf(fp, "foo\012bar\012");
}
if ( fp = freopen("binaryplus", "wb+", fp) ) {
fprintf(fp, "foo\nbar\n");
fprintf(fp, "foo\012bar\012");
fprintf(fp, "foo\eEbar\eE");
}
}

0 comments on commit c03ae48

Please sign in to comment.