Issue 96058 - unotools: ambiguous && and ||
Summary: unotools: ambiguous && and ||
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: code (show other issues)
Version: DEV300m35
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: Mathias_Bauer
QA Contact: Unknown
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-10 16:43 UTC by caolanm
Modified: 2009-02-25 09:26 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
what we're currently saying (724 bytes, patch)
2008-11-10 16:44 UTC, caolanm
no flags Details | Diff
what I suspect we want to say (724 bytes, patch)
2008-11-10 16:44 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-11-10 16:43:35 UTC
unotools/source/ucbhelper/ucbhelper.cxx has the following code..

BOOL bWild = bAllowWildCards && rName.Search( '*' ) != STRING_NOTFOUND ||
rName.Search( '?' ) != STRING_NOTFOUND;

which precedence-wise binds as...

BOOL bWild = (bAllowWildCards && rName.Search( '*' ) != STRING_NOTFOUND) ||
rName.Search( '?' ) != STRING_NOTFOUND;

(as attachment one would do), but that looks really suspicious, I suspect it
should be 

BOOL bWild = bAllowWildCards && (rName.Search( '*' ) != STRING_NOTFOUND ||
rName.Search( '?' ) != STRING_NOTFOUND);

as attachment two does
Comment 1 caolanm 2008-11-10 16:44:22 UTC
Created attachment 57840 [details]
what we're currently saying
Comment 2 caolanm 2008-11-10 16:44:52 UTC
Created attachment 57841 [details]
what I suspect we want to say
Comment 3 Frank Schönheit 2008-11-10 16:54:31 UTC
fs->mba: your code, cvs-blame-wise
Comment 4 Mathias_Bauer 2008-11-18 16:57:01 UTC
Yes, it looks as if indeed that the current code is wrong.
Thanks for the patch.
Comment 5 Mathias_Bauer 2008-12-03 09:41:11 UTC
Fixed in CWS mba31issues01
Comment 6 Mathias_Bauer 2009-01-27 11:55:15 UTC
@cmc: i've set this to "verified" as I know you will check this in the master
anyway. :-)
Comment 7 caolanm 2009-02-25 09:26:32 UTC
closed, seen DEV300_m42