Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 21392

Summary: rpmvercmp ordering imperfect
Product: [Retired] Red Hat Linux Reporter: Greg Hudson <ghudson>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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: --- Target Upstream Version:
Embargoed:

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.