Summary: | xps_strcasecmp() causes issues when expected to behave like strcasecmp() | ||
---|---|---|---|
Product: | GhostXPS | Reporter: | Dave Geering <dgeering> |
Component: | General | Assignee: | Tor Andersson <tor.andersson> |
Status: | NOTIFIED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | master | ||
Hardware: | All | ||
OS: | All | ||
Customer: | Word Size: | --- | |
Attachments: | Patch for xps_strcasecmp() issue |
Description
Dave Geering
2008-07-28 21:49:46 UTC
Created attachment 4246 [details]
Patch for xps_strcasecmp() issue
Patch using -p1 and inside xps directory.
Upon further investigation, I've found that xps_strcasecmp() returns a match when string1 is shorter than string2 only when the case is different! After reviewing the code for xps_strcasecmp() I found it uses another compatibility function xps_tolower(). The logic in xps_tolower() is the problem. Line 7 of xpsmem.c: if (x >= 'A' || x <= 'Z') should read if (x >= 'A' && x <= 'Z') The attached patch is therefore not an ideal solution considering strcasecmp is not available on all platforms. This bug was discovered and fixed a long time ago. You may want to update to a newer version of the source. Sorry to bring up an old bug. I will use a snapshot rather than the 1.52 source. |