Style inquistion for util and some tools.
This commit is contained in:
9
cat.c
9
cat.c
@@ -2,6 +2,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
|
||||
@@ -16,13 +17,15 @@ main(int argc, char *argv[])
|
||||
eprintf("usage: %s [files...]\n", argv0);
|
||||
} ARGEND;
|
||||
|
||||
if(argc == 0)
|
||||
if(argc == 0) {
|
||||
concat(stdin, "<stdin>", stdout, "<stdout>");
|
||||
else for(i = 0; i < argc; i++) {
|
||||
} else for(i = 0; i < argc; i++) {
|
||||
if(!(fp = fopen(argv[i], "r")))
|
||||
eprintf("fopen %s:", argv[i]);
|
||||
|
||||
concat(fp, argv[i], stdout, "<stdout>");
|
||||
fclose(fp);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user