From d91cf802770ba969a0865f9a7fd24e5bc8367d06 Mon Sep 17 00:00:00 2001 From: arcanum Date: Wed, 23 Apr 2003 16:36:01 +0000 Subject: [PATCH] Fix for bug #3293. Set correct open mode for raw format for Windows. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@321 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 5 +++++ fileio.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0cfc7d85..61af3fa8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-04-23 Eric B. Weddington + + * fileio.c: Fix for bug #3293. Set correct open mode for raw format + for Windows. + 2003-04-18 Theodore A. Roth * configure.ac: Add cvs suffix back to version. diff --git a/fileio.c b/fileio.c index d70e427a..f2251d27 100644 --- a/fileio.c +++ b/fileio.c @@ -950,6 +950,21 @@ int fileio(int op, char * filename, FILEFMT format, if (rc < 0) return -1; + #if defined(__CYGWIN__) + /* Open Raw Binary format in binary mode on Windows.*/ + if(format == FMT_RBIN) + { + if(fio.op == FIO_READ) + { + fio.mode = "rb"; + } + if(fio.op == FIO_WRITE) + { + fio.mode = "wb"; + } + } + #endif + /* point at the requested memory buffer */ buf = mem->buf; if (fio.op == FIO_READ)