dav/main.c

changeset 72
aac29f2e8030
parent 70
88092b88ec00
child 73
41e88442ad4e
equal deleted inserted replaced
71:c9aff0a0093d 72:aac29f2e8030
622 } 622 }
623 623
624 return 0; 624 return 0;
625 } 625 }
626 626
627 FILE *fout = !strcmp(out, "-") ? stdout : fopen(out, "w"); 627 FILE *fout = !strcmp(out, "-") ? stdout : fopen(out, "wb");
628 if(!fout) { 628 if(!fout) {
629 fprintf(stderr, "cannot open output file\n"); 629 fprintf(stderr, "cannot open output file\n");
630 return -1; 630 return -1;
631 } 631 }
632 632
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);

mercurial