Fixed handling of '-' for stdin
This commit is contained in:
parent
f0247ac9c5
commit
4631d532e0
@ -226,6 +226,8 @@ cmd_args process_cmd_args(int argc, char** argv){
|
|||||||
}
|
}
|
||||||
if(!strcmp(argv[i], "--")){
|
if(!strcmp(argv[i], "--")){
|
||||||
escaped = true;
|
escaped = true;
|
||||||
|
}else if(!strcmp(argv[i], "-")){
|
||||||
|
ret.filenames.push_back(argv[i]);
|
||||||
}else if(IS_SHORT_OPTION(argv[i])){
|
}else if(IS_SHORT_OPTION(argv[i])){
|
||||||
size_t arg_len = strlen(argv[i]);
|
size_t arg_len = strlen(argv[i]);
|
||||||
int next_arg = i+1;
|
int next_arg = i+1;
|
||||||
|
|||||||
@ -126,6 +126,7 @@ int print_files(cmd_args& args){
|
|||||||
if(in == L'\n') //Only reset on newline to save print overhead
|
if(in == L'\n') //Only reset on newline to save print overhead
|
||||||
p.reset();
|
p.reset();
|
||||||
}
|
}
|
||||||
|
clearerr(stdin);
|
||||||
}else{ //everything besides stdin
|
}else{ //everything besides stdin
|
||||||
FILE* fp = fopen(args.filenames[i], "r");
|
FILE* fp = fopen(args.filenames[i], "r");
|
||||||
if(!fp){
|
if(!fp){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user