forked from bonsai/harakit
cat(1p): trimming size
This commit is contained in:
parent
96d692d26e
commit
0c290646ec
@ -19,12 +19,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sysexits.h>
|
#include <sysexits.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
void cat(FILE *file, bool u) {
|
void cat(FILE *file, bool u) {
|
||||||
@ -97,7 +94,7 @@ int main(int argc, char *argv[]) {
|
|||||||
for (i = optind; i < argc; i++) {
|
for (i = optind; i < argc; i++) {
|
||||||
if (argv[i][0] == '-' && argv[i][1] != '\0') {
|
if (argv[i][0] == '-' && argv[i][1] != '\0') {
|
||||||
continue;
|
continue;
|
||||||
} else if (strcmp(argv[i], "-") == 0) {
|
} else if (argv[i][0] == '-' && argv[i][1] == '\0') {
|
||||||
file = stdin;
|
file = stdin;
|
||||||
} else if ((file = fopen(argv[i], "r")) == NULL) {
|
} else if ((file = fopen(argv[i], "r")) == NULL) {
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
|
Loading…
Reference in New Issue
Block a user