richardphibel / rpms / rpm

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