Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 148861 Details for
Bug 216483
update-eix fails
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix faulty comparison for =* masks
mask-compare-#216483.patch (text/plain), 2.21 KB, created by
Emil Beinroth
on 2008-04-06 13:38:43 UTC
(
hide
)
Description:
Fix faulty comparison for =* masks
Filename:
MIME Type:
Creator:
Emil Beinroth
Created:
2008-04-06 13:38:43 UTC
Size:
2.21 KB
patch
obsolete
>Index: src/portage/mask.cc >=================================================================== >--- src/portage/mask.cc (revision 659) >+++ src/portage/mask.cc (revision 661) >@@ -177,11 +177,30 @@ > { > // '=*' operator has to remove leading zeros > // see match_from_list in portage_dep.py >- const std::string& s1(getFull()); >- const std::string& s2(ev->getFull()); >- const std::string::size_type start = s1.find_first_not_of('0'); >- const std::string::size_type total = s1.size() - start; >- return s2.compare(s2.find_first_not_of('0'), total, s1, start, total) == 0; >+ const std::string& my_string(getFull()); >+ const std::string& version_string(ev->getFull()); >+ >+ std::string::size_type my_start = my_string.find_first_not_of('0'); >+ std::string::size_type version_start = version_string.find_first_not_of('0'); >+ >+ /* Otherwise, if a component has a leading zero, any trailing >+ * zeroes in that component are stripped (if this makes the >+ * component empty, proceed as if it were 0 instead), and the >+ * components are compared using a stringwise comparison. >+ */ >+ >+ if (my_start == std::string::npos) >+ my_start = my_string.size() - 1; >+ else if(! isdigit(my_string[my_start])) >+ my_start -= 1; >+ >+ if (version_start == std::string::npos) >+ version_start = version_string.size() - 1; >+ else if(! isdigit(version_string[version_start])) >+ version_start -= 1; >+ >+ const std::string::size_type total = my_string.size() - my_start; >+ return version_string.compare(version_start, total, my_string, my_start, total) == 0; > } > > case maskOpLess: >Index: src/portage/basicversion.cc >=================================================================== >--- src/portage/basicversion.cc (revision 659) >+++ src/portage/basicversion.cc (revision 661) >@@ -48,6 +48,12 @@ > rtrim(&l1, "0"); > rtrim(&l2, "0"); > >+ /* No need to check if stripping zeros makes the component empty, >+ * since that only happens for components that _only_ contain zeros >+ * and comparing to "0" or "" will yield the same result - every >+ * other possible value is bigger. >+ */ >+ > return l1.compare(l2); > } > // "If neither component has a leading zero, components are compared
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 216483
: 148861