diff macro.c @ 170:2ee7db420643

Fix joerg's expansionitem_eq(). Was wrong previously.
author David A. Holland
date Fri, 12 Jun 2015 02:02:38 -0400
parents 80e243f2047d
children 5922e6ca6b80
line wrap: on
line diff
--- a/macro.c	Fri Jun 12 02:01:00 2015 -0400
+++ b/macro.c	Fri Jun 12 02:02:38 2015 -0400
@@ -143,17 +143,23 @@
 expansionitem_eq(const struct expansionitem *ei1,
 		 const struct expansionitem *ei2)
 {
-	if ((ei1->itemtype == EI_STRING) != (ei2->itemtype == EI_STRING)) {
+	if (ei1->itemtype != ei2->itemtype) {
 		return false;
 	}
-	if (ei1->itemtype == EI_STRING) {
+	switch (ei1->itemtype) {
+	    case EI_STRING:
 		if (strcmp(ei1->string, ei2->string) != 0) {
 			return false;
 		}
-	} else {
+		break;
+	    case EI_PARAM:
 		if (ei1->param != ei2->param) {
 			return false;
 		}
+		break;
+	    case EI_FILE:
+	    case EI_LINE:
+		break;
 	}
 	return true;
 }