Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
L
libao
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 32
    • Issues 32
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 3
    • Merge Requests 3
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Xiph.Org
  • libao
  • Merge Requests
  • !1

Merged
Opened Jul 28, 2019 by Clayton Smith@argiloContributor

Use binary mode for file output

  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 1

File output does not work properly on Windows, at least under MinGW. This is because ao_open_file does not pass the b flag to fopen, and so the file is opened in text mode. A carriage return character is then inserted into the output file before each line feed character.

As noted here, applications can request binary mode by using the b flag:

https://cygwin.com/faq.html#faq.api.cr-lf

In POSIX operating systems, the b flag is ignored:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html

Therefore, it should be safe to add it here.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: xiph/libao!1
Source branch: fix-windows-file-output