| Summary: | Build issue: bibletime error on rpmlint | ||
|---|---|---|---|
| Product: | TDE | Reporter: | Francois Andriot <albator78> |
| Component: | non-core programs | Assignee: | Francois Andriot <albator78> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | albator78, bugwatch, slavek.banko |
| Priority: | P5 | ||
| Version: | R14.0.0 [Trinity] | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Compiler Version: | TDE Version String: | ||
| Application Version: | Application Name: | ||
| Bug Depends on: | |||
| Bug Blocks: | 2246 | ||
| Attachments: |
bibletime: use strcmp instead of string comparison
bibletime: use strcmp instead of string comparison (2) |
||
|
Description
Francois Andriot
2015-03-21 11:30:10 CDT
Created attachment 2470 [details]
bibletime: use strcmp instead of string comparison
The attached patch makes rpmlint happy with the string comparisons.
François, I believe that the patch causes a reversal of the sense of conditions. Previous getGlobalOption( optionName(type).latin1() ) == "On" gives a 'true' if strings are identical. While strcmp if strings are identical gives '0' => therefore 'false'. AFAIK, in C++, "integer 0" translates to "boolean true", and "any integer other than 0" translates to "boolean false". In shell scripting, it's the contrary ... "0" means "false" and "anything above 0" means "true". (In reply to Francois Andriot from comment #3) > AFAIK, in C++, "integer 0" translates to "boolean true", and "any integer > other than 0" translates to "boolean false". > > In shell scripting, it's the contrary ... "0" means "false" and "anything > above 0" means "true". Oh no, it's precisely the contrary of what I said ... please ignore this comment, and yes, you're right, the patch probably does the contrary of expected behaviour. Created attachment 2471 [details]
bibletime: use strcmp instead of string comparison (2)
This patch should produce the expected behaviour.
Comment on attachment 2471 [details]
bibletime: use strcmp instead of string comparison (2)
Pushed to GIT in hash a18630c3 (master) and 5ae4a0b3 (r14.0.x).
|