r4018: Auto commit for Debian build
authorKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 12 Feb 2003 06:10:19 +0000 (06:10 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 12 Feb 2003 06:10:19 +0000 (06:10 +0000)
debian/changelog
wdq2wav.cpp

index ea5c13f4b43c808ae664fe555bfea05e05c7b634..1380766925497ef3a7ec86b85203e380b99d3f20 100644 (file)
@@ -1,3 +1,9 @@
+wdq2wav (0.3.2-1) unstable; urgency=low
+
+  * New upstream, fix for opening binary files with cygwin
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Tue, 11 Feb 2003 23:06:52 -0700
+
 wdq2wav (0.3.1-1) unstable; urgency=low
 
   * Update manpage
index ff0430a21fdfa5e82f2d9794c7303210b9196104..392a108d71835413badb9c84afa4f56a66cd6133 100644 (file)
@@ -8,7 +8,7 @@
 **
 **  Copyright (c) 2003 Kevin Rosenberg
 **
-**  $Id: wdq2wav.cpp,v 1.14 2003/01/21 19:52:20 kevin Exp $
+**  $Id: wdq2wav.cpp,v 1.15 2003/02/12 06:10:19 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
 
 #include <wdq2wav.h>
 
-const char* g_szIdStr = "$Id: wdq2wav.cpp,v 1.14 2003/01/21 19:52:20 kevin Exp $";
+const char* g_szIdStr = "$Id: wdq2wav.cpp,v 1.15 2003/02/12 06:10:19 kevin Exp $";
 
 bool g_quiet = false;
 bool g_verbose = false;
 bool g_debug = false;
 
+// Define as NULL for non-Windows platforms
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+
 void
 error_msg (const char *msg)
 {
@@ -306,7 +312,7 @@ WindaqFile::ReadHeader ()
   unsigned short int tmp2;
 
   m_valid = false;
-  if ((m_fd = open (m_strFile.c_str(), O_RDONLY)) < 0) {
+  if ((m_fd = open (m_strFile.c_str(), O_RDONLY | O_BINARY)) < 0) {
     m_error = "Unable to open file";
     return false;
   }
@@ -607,7 +613,7 @@ WavFile::WriteFile ()
     return false;
 
   if (m_fd == 0)
-    if ((m_fd = open (m_strFile.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 
+    if ((m_fd = open (m_strFile.c_str(), O_WRONLY | O_BINARY | O_TRUNC | O_CREAT, 
                      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == 0) {
       std::ostringstream os;
       os << "Error opening output file " << m_strFile.c_str();