5523e9
From 817959609b95afe34ce0f7f6c3dc5d7d0d9a8470 Mon Sep 17 00:00:00 2001
5523e9
From: Panu Matilainen <pmatilai@redhat.com>
5523e9
Date: Wed, 25 Jun 2014 11:28:02 +0300
5523e9
Subject: [PATCH] Handle line continuation in grabArgs() (related to
5523e9
 RhBug:1045723)
5523e9
5523e9
- Commit 1bdcd0500865efd3566efd7f951228f69b58e755 to fix RhBug:1045723
5523e9
  broke some funky java macros in Fedora which include line continuation
5523e9
  in the argument (comments 6-7 in the bug). That it ever worked seems
5523e9
  far more like luck than by design but since this seems to fix it...
5523e9
---
5523e9
 rpmio/macro.c | 3 ++-
5523e9
 1 file changed, 2 insertions(+), 1 deletion(-)
5523e9
5523e9
diff --git a/rpmio/macro.c b/rpmio/macro.c
5523e9
index 12a65a4..b00155c 100644
5523e9
--- a/rpmio/macro.c
5523e9
+++ b/rpmio/macro.c
5523e9
@@ -771,7 +771,8 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
5523e9
 
5523e9
 exit:
5523e9
     argvFree(argv);
5523e9
-    return (*lastc == '\0' || *lastc == '\n') ? lastc : lastc + 1;
5523e9
+    return ((*lastc == '\0' || *lastc == '\n') && *(lastc-1) != '\\') ?
5523e9
+	   lastc : lastc + 1;
5523e9
 }
5523e9
 
5523e9
 /**
5523e9
-- 
5523e9
2.1.0
5523e9