Bug 7399

Summary: %if construct doesn't parse macro names correctly
Product: [Retired] Red Hat Linux Reporter: yates
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.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: 1999-11-29 14:17:51 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 yates 1999-11-28 21:02:09 UTC
The %if construct doesn't recognize "_" as a legas first character in a
macro name.  For example
	%define _foo bar
	...
	%if _foo == "bar"
	...
gets an error, wheras
	%define foo bar
	...
	%if foo == "bar"
	...
does not.

Suggest changing line 265 in expression.c
	    } else if (isalpha(*p)) {
to
	    } else if (isalpha(*p) || *p == '_') {

Comment 1 Jeff Johnson 1999-11-29 14:17:59 UTC
This had been fixed in (at least) rpm-3.0.4. Thanks for the patch.