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