mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 00:31:16 +00:00
Handle 'cat -'
This commit is contained in:
parent
f34aa4c378
commit
d1de4a16ad
7
cat.c
7
cat.c
@ -31,11 +31,10 @@ extern int cat_main(int argc, char **argv)
|
|||||||
exit(TRUE);
|
exit(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (**(argv + 1) == '-')
|
|
||||||
usage(cat_usage);
|
|
||||||
|
|
||||||
while (--argc > 0) {
|
while (--argc > 0) {
|
||||||
if (print_file_by_name(*++argv) == FALSE) {
|
if(!(strcmp(*++argv, "-"))) {
|
||||||
|
print_file(stdin);
|
||||||
|
} else if (print_file_by_name(*argv) == FALSE) {
|
||||||
perror(*argv);
|
perror(*argv);
|
||||||
exit(FALSE);
|
exit(FALSE);
|
||||||
}
|
}
|
||||||
|
@ -31,11 +31,10 @@ extern int cat_main(int argc, char **argv)
|
|||||||
exit(TRUE);
|
exit(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (**(argv + 1) == '-')
|
|
||||||
usage(cat_usage);
|
|
||||||
|
|
||||||
while (--argc > 0) {
|
while (--argc > 0) {
|
||||||
if (print_file_by_name(*++argv) == FALSE) {
|
if(!(strcmp(*++argv, "-"))) {
|
||||||
|
print_file(stdin);
|
||||||
|
} else if (print_file_by_name(*argv) == FALSE) {
|
||||||
perror(*argv);
|
perror(*argv);
|
||||||
exit(FALSE);
|
exit(FALSE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user