Basically the changes are now:
- Drop the nih_assert when we get a char * const * variable.
- Don't try to iterate through an array before first checking that it's non-NULL.
- Update the tests.
The diff is fairly big on the tests side because of all the re-indent that was needed, for each of the tests, the only change that was done was adding the "if (variable) {" <insert loop here> "}".
I also had to do a few more changes in marshal.c than I'd have liked, that's because nih-dbus-tool wants to generate a properly indented file as output, so I had to move the loop to a new block so I can indent it if needed.
With that, all the nih tests pass and my upstart branch builds fine, passes its own tests and appears to run fine too.
Quick test with experimental upstart:
>> initctl --session emit bla test=abc
method call sender=:1.5 -> dest=com.ubuntu.Upstart serial=4 path=/com/ubuntu/Upstart; interface=com.ubuntu.Upstart0_6; member=EmitEvent
string "bla"
array [
string "test=abc"
]
boolean true
^ And that's for the missing changes.
Basically the changes are now:
- Drop the nih_assert when we get a char * const * variable.
- Don't try to iterate through an array before first checking that it's non-NULL.
- Update the tests.
The diff is fairly big on the tests side because of all the re-indent that was needed, for each of the tests, the only change that was done was adding the "if (variable) {" <insert loop here> "}".
I also had to do a few more changes in marshal.c than I'd have liked, that's because nih-dbus-tool wants to generate a properly indented file as output, so I had to move the loop to a new block so I can indent it if needed.
With that, all the nih tests pass and my upstart branch builds fine, passes its own tests and appears to run fine too.
Quick test with experimental upstart: ubuntu. Upstart serial=4 path=/com/ ubuntu/ Upstart; interface= com.ubuntu. Upstart0_ 6; member=EmitEvent
>> initctl --session emit bla test=abc
method call sender=:1.5 -> dest=com.
string "bla"
array [
string "test=abc"
]
boolean true
>> initctl --session emit bla ubuntu. Upstart serial=4 path=/com/ ubuntu/ Upstart; interface= com.ubuntu. Upstart0_ 6; member=EmitEvent
method call sender=:1.4 -> dest=com.
string "bla"
array [
]
boolean true