diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 7564fc36..1df68761 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -6,6 +6,11 @@ * src/apps/jtag/jtag.c: Unify jtag home dir parsing and add support for the Windows home env var names. + * src/apps/bsdl2jtag/bsdl2jtag.c, src/bsdl/bsdl.c, src/bsdl/vhdl_flex.l, + src/cmd/cmd_readmem.c, src/cmd/cmd_svf.c, src/cmd/cmd_writemem.c, + src/global/parse.c, src/tap/detect.c: Add "b" to the fopen() mode string + for Windows and such [2874517] by Daryl Tester. + 2010-06-29 Mike Frysinger * src/tap/cable/generic_usbconn_list.h: Macro away duplicate ftdi lists. diff --git a/urjtag/src/apps/bsdl2jtag/bsdl2jtag.c b/urjtag/src/apps/bsdl2jtag/bsdl2jtag.c index 1d52c2c1..17566d0b 100644 --- a/urjtag/src/apps/bsdl2jtag/bsdl2jtag.c +++ b/urjtag/src/apps/bsdl2jtag/bsdl2jtag.c @@ -80,7 +80,7 @@ main (int argc, char *const argv[]) return 1; } - jtag_file = fopen (argv[2], "w"); + jtag_file = fopen (argv[2], "wb"); if (jtag_file == NULL) { printf ("Error: Can't open '%s' in write mode.\n", argv[2]); diff --git a/urjtag/src/bsdl/bsdl.c b/urjtag/src/bsdl/bsdl.c index 4aebfd3b..8f8f62cb 100644 --- a/urjtag/src/bsdl/bsdl.c +++ b/urjtag/src/bsdl/bsdl.c @@ -112,7 +112,7 @@ urj_bsdl_read_file (urj_chain_t *chain, const char *BSDL_File_Name, jtag_ctrl.part = NULL; } - BSDL_File = fopen (BSDL_File_Name, "r"); + BSDL_File = fopen (BSDL_File_Name, "rb"); urj_bsdl_msg (proc_mode, _("Reading file '%s'\n"), BSDL_File_Name); diff --git a/urjtag/src/bsdl/vhdl_flex.l b/urjtag/src/bsdl/vhdl_flex.l index 992e62c8..3f28418c 100644 --- a/urjtag/src/bsdl/vhdl_flex.l +++ b/urjtag/src/bsdl/vhdl_flex.l @@ -501,7 +501,7 @@ urj_vhdl_flex_switch_file (yyscan_t scanner, char *filename) extra = yyget_extra (scanner); /* file in current directory has precedence */ - f = fopen (filename, "r"); + f = fopen (filename, "rb"); if (!f) { const char *db_path = urj_get_data_dir (); @@ -518,7 +518,7 @@ urj_vhdl_flex_switch_file (yyscan_t scanner, char *filename) strcat (db_file, "bsdl"); strcat (db_file, "/"); strcat (db_file, filename); - f = fopen (db_file, "r"); + f = fopen (db_file, "rb"); if (!f) urj_bsdl_ftl_set (extra->proc_mode, URJ_ERROR_IO, diff --git a/urjtag/src/cmd/cmd_readmem.c b/urjtag/src/cmd/cmd_readmem.c index 96c353c2..e4d97cad 100644 --- a/urjtag/src/cmd/cmd_readmem.c +++ b/urjtag/src/cmd/cmd_readmem.c @@ -62,7 +62,7 @@ cmd_readmem_run (urj_chain_t *chain, char *params[]) || urj_cmd_get_number (params[2], &len) != URJ_STATUS_OK) return URJ_STATUS_FAIL; - f = fopen (params[3], "w"); + f = fopen (params[3], "wb"); if (!f) { urj_error_IO_set (_("Unable to create file `%s'"), params[3]); diff --git a/urjtag/src/cmd/cmd_svf.c b/urjtag/src/cmd/cmd_svf.c index 385b18db..48d672d5 100644 --- a/urjtag/src/cmd/cmd_svf.c +++ b/urjtag/src/cmd/cmd_svf.c @@ -78,7 +78,7 @@ cmd_svf_run (urj_chain_t *chain, char *params[]) if (print_progress) urj_log_state.level = URJ_LOG_LEVEL_DETAIL; - if ((SVF_FILE = fopen (params[1], "r")) != NULL) + if ((SVF_FILE = fopen (params[1], "rb")) != NULL) { result = urj_svf_run (chain, SVF_FILE, stop, ref_freq); diff --git a/urjtag/src/cmd/cmd_writemem.c b/urjtag/src/cmd/cmd_writemem.c index 73feb936..b3281e7a 100644 --- a/urjtag/src/cmd/cmd_writemem.c +++ b/urjtag/src/cmd/cmd_writemem.c @@ -60,7 +60,7 @@ cmd_writemem_run (urj_chain_t *chain, char *params[]) || urj_cmd_get_number (params[2], &len) != URJ_STATUS_OK) return URJ_STATUS_FAIL; - f = fopen (params[3], "r"); + f = fopen (params[3], "rb"); if (!f) { urj_error_IO_set (_("Unable to open file `%s'"), params[3]); diff --git a/urjtag/src/global/parse.c b/urjtag/src/global/parse.c index 82132c9b..387eabfa 100644 --- a/urjtag/src/global/parse.c +++ b/urjtag/src/global/parse.c @@ -202,7 +202,7 @@ urj_parse_file (urj_log_level_t ll, urj_chain_t *chain, const char *filename) FILE *f; int go; - f = fopen (filename, "r"); + f = fopen (filename, "rb"); if (!f) { urj_error_IO_set ("Cannot open file '%s' to parse", filename); diff --git a/urjtag/src/tap/detect.c b/urjtag/src/tap/detect.c index 39502b2a..6206be41 100644 --- a/urjtag/src/tap/detect.c +++ b/urjtag/src/tap/detect.c @@ -59,7 +59,7 @@ find_record (char *filename, urj_tap_register_t *key, struct id_record *idr) urj_tap_register_t *tr; int r = 0; - file = fopen (filename, "r"); + file = fopen (filename, "rb"); if (!file) { urj_log (URJ_LOG_LEVEL_ERROR, _("Unable to open file '%s'\n"), filename);