chantra / rpms / rpm

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