Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the macro GETOPT_SUPPORT is disabled, the built binary cannot interpret the output file name "-" as a pipe. #1403

Closed
ghost opened this issue Oct 9, 2024 · 1 comment · Fixed by #1404
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Oct 9, 2024

FluidSynth version

fluidsynth -version
FluidSynth runtime version 2.3.6
Copyright (C) 2000-2024 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.

Describe the bug

On the command line, an output filename "-" following "-F" is misinterpreted as the start of another option.
In this case, an error will occur indicating an incorrect option specification.

This problem occurs when building with the macro GETOPT_SUPPORT disabled.
For example, when building Fluidsynth binaries for Windows with Microsoft Visual Studio.

Expected behavior

The command line option "-F -" is expected to be interpreted as outputting audio to a pipe.
The release binaries distributed on fluidsynth's github work as expected and do not have this issue.

Steps to reproduce

>fluidsynth.exe -F -
Expected argument to option -F found switch instead
Usage: fluidsynth [options] [soundfonts]
Try -h for help.

Additional context

This issue can be fixed by updating the code in fluidsynth.c as follows:

if(optarg[0] == '-')

- if(optarg[0] == '-') 
+ if ((optarg[0] == '-') && ((optarg[1] != '\0') || (c != 'F')))
@ghost ghost added the bug label Oct 9, 2024
@derselbst derselbst linked a pull request Oct 12, 2024 that will close this issue
@derselbst
Copy link
Member

Thanks! Will be implemented as suggested.

@derselbst derselbst added this to the 2.3 milestone Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant