719 closedir(dir); |
719 closedir(dir); |
720 } else if(S_ISREG(s.st_mode)) { |
720 } else if(S_ISREG(s.st_mode)) { |
721 /* |
721 /* |
722 * use stdin if the input file is - |
722 * use stdin if the input file is - |
723 */ |
723 */ |
724 FILE *in = fopen(file, "r"); |
724 FILE *in = fopen(file, "rb"); |
725 if(!in) { |
725 if(!in) { |
726 fprintf(stderr, "cannot open input file\n"); |
726 fprintf(stderr, "cannot open input file\n"); |
727 return -1; |
727 return -1; |
728 } |
728 } |
729 char *filename = util_resource_name(file); |
729 char *filename = util_resource_name(file); |