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

mix-to-mono: '-' is not a clash of names #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janstary
Copy link

This fixes #94

oname = argv[2];
}

if (strcmp(iname, "-") == 0 || strcmp(oname, "-") == 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second strcmp() is not required, because the error is only raised if the names are the same. So if the input isn't a dash and the names are the same, then we know the output also isn't a dash. Or to put it another way, we only need to check for name collisions when the input isn't a dash, and if that is the case, an output dash won't collide with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mix-to-mono vs stdin and stdout
2 participants