4c9460
From 1bdcd0500865efd3566efd7f951228f69b58e755 Mon Sep 17 00:00:00 2001
4c9460
From: Panu Matilainen <pmatilai@redhat.com>
4c9460
Date: Wed, 19 Feb 2014 14:16:38 +0200
4c9460
Subject: [PATCH] Dont eat newlines on parametrized macro invocations
4c9460
 (RhBug:1045723)
4c9460
4c9460
- Makes the testcase from commit f082b5baa4dcf9601eeb1e0e520ff06e77dc61c0
4c9460
  succeed. While the old behavior is non-sensical and most likely entirely
4c9460
  unintentional, we're changing a very long-standing behavior here (tested
4c9460
  back to rpm 4.4.x and almost certainly much much older than that) so
4c9460
  its entirely possible people are actually relying on the old
4c9460
  behavior. Lets see what breaks...
4c9460
---
4c9460
 rpmio/macro.c | 2 +-
4c9460
 1 file changed, 1 insertion(+), 1 deletion(-)
4c9460
4c9460
diff --git a/rpmio/macro.c b/rpmio/macro.c
4c9460
index e1c2a91..72471a2 100644
4c9460
--- a/rpmio/macro.c
4c9460
+++ b/rpmio/macro.c
4c9460
@@ -764,7 +764,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
4c9460
 
4c9460
 exit:
4c9460
     argvFree(argv);
4c9460
-    return *lastc ? lastc + 1 : lastc; 
4c9460
+    return (*lastc == '\0' || *lastc == '\n') ? lastc : lastc + 1;
4c9460
 }
4c9460
 
4c9460
 /**
4c9460
-- 
4c9460
2.1.0
4c9460