Bug 21392 - rpmvercmp ordering imperfect
Summary: rpmvercmp ordering imperfect
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-27 21:03 UTC by Greg Hudson
Modified: 2007-04-18 16:30 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-27 21:03:20 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Greg Hudson 2000-11-27 21:03:18 UTC
I was looking over the rpmvercmp() code and noticed that:

	rpmvercmp("1.", "1.a") -> -1
	rpmvercmp("1.a", "1.") -> -1

because of the following two lines of code:

	/* take care of the case where the two version segments are */
	/* different types: one numeric and one alpha */
	if (one == str1) return -1;	/* arbitrary */
	if (two == str2) return -1;

Perhaps the (two == str2) case should return 1 instead of -1.  The comments
also seem off; the (one == str1) case occurs only when the first segment is
empty, for instance.

Comment 1 Jeff Johnson 2001-03-15 14:15:56 UTC
Added to rpm CVS. Thanks for noticing.


Note You need to log in before you can comment on or make changes to this bug.