-
Notifications
You must be signed in to change notification settings - Fork 26
libubox: Drop extraneous space when appending values to variable #16
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
base: master
Are you sure you want to change the base?
Conversation
|
Can we please get some progress on this? |
|
Robert (@robimarko) do you think thank you could help Philip to look at this? :) |
|
Could you describe a "test case" where this helps. This could be just a few lines of codes where the patch creates a difference. Just by looking at it, I don't understand it. |
If you do: You'll end up with |
|
Functions starting with an underscore are internal functions. Are there paths to trigger the difference without using those that affect the final JSON? |
I don't understand the question. One of the variables modified by |
|
This is trivial to demonstrate. And fix. It's a 3-line test and a 1 line fix. This might be why we're not seeing new contributors sign up.... |
Don't have a leading space when building out a variable via appends. fixes: issue openwrt#15 Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Philip Prindeville <[email protected]>
dace612 to
95481d8
Compare
|
If it's trivial to demonstrate, then please demonstrate it. I am not asking for direct calls to this particular function as this is an internal function that should not be used directly. This "names that start with underscore are internal API only" is a common convention used in languages that have no or a limited concept of encapsulation. So I am asking for a script that constructs a json object, json array or whatever using the public API only (functions not starting with an underscore) where you suggested change causes a difference.
When contributing, I expect some quality assurance. If I can not explain why my change is an improvement, I don't expect anyone to accept it upstream. That's why the explanation of the change sometimes takes much more effort than the actual change. I don't know your expectations. This is also the other way around: If I see some project merging random stuff without reason, I can not trust that project anymore. |
I'm not saying it's publicly callable. But in writing additional functions (which are) that call through it, those functions didn't operate correctly because of the leading space interfering. This fix is a prerequisite to PR #6. To reiterate, this bug was confirmed by @nbd168 and he provided the fix. |
|
So #6 is affected by this changes? Which difference does it create there and where/why? |
I had to copy and paste |
If you (as someone extending this library) use
__jshn_append()it will create a string with an undesired leading space.fixes: issue #15