-
Notifications
You must be signed in to change notification settings - Fork 169
[sfntedit.exe] bug in redirection of help to text file #126
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
Comments
I agree the test case shows a bug. I think your fix is correct. It is a simple and safe change, and there is no reason for help and usage text to be sent to stderr. I have little experience on Windows, so I am all for having you testing this case. |
I think, that the help should be send to stderr below the error message, if an argument is invalid. And if there is no error, the help should be send to stdout. I only could replace stderr by stdout. Shall I do that and submit a pull request? Or do you want to fix it by yourself? By the way (just seen): The behaviour of detype1.exe and type1.exe is also a bit odd with regard to the help and stderr. In both cases it is not directly a help, but only a short usage information. But only in case of type1.exe, you get a short error message ("Unknown Option encountered: -h") above the usage info. I did not find the reason for the different behaviour in the code. But as I have written: I don't know anything about C. |
Fixed via #613 |
This results in a 0 byte text file:
But this works:
stdout (standard output) and stderr (standard error output) seem to be messed up.
I would not wonder about this behaviour, if it wouldn't be different from checkoutlines.exe, IS.exe, makeotf.exe, mergeFonts.exe, rotateFont.exe, sfntdiff.exe, Spot.exe and TX.exe, for which ">" only works.
Edit:
Just for fun I will try to fix this by myself, although I don't know anything about C.
main.c in afdko-master\FDK\Tools\Programs\sfntedit\source
looks different from
Dmain.c in afdko-master\afdko-master\FDK\Tools\Programs\sfntdiff\source
with regard to the handling of the output.
At least this looks suspicious in my end user eyes. A few lines from main.c:
Edit 2: It works, if I replace stderr with stdout in main.c. But because it does not work, if I simply delete stderr, I let my fingers on this.
The text was updated successfully, but these errors were encountered: