summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlina Moravcova Varekova <pmoravco@redhat.com>2019-09-03 10:19:02 +0200
committerPanu Matilainen <pmatilai@redhat.com>2019-11-18 12:46:29 +0200
commit2bd3d43e7276190a667e417f4265fdd7dcb6d882 (patch)
tree17a251348eca6e41dfd17a6d21db0eac52956b7f
parent44fc44023bdb555e080264bdd04a62f1af29b068 (diff)
downloadrpm-2bd3d43e7276190a667e417f4265fdd7dcb6d882.tar.gz
Disable marker on multiline expression error messages
If an expression multiline like: %{expr: 0 || 0 || 0 || 0 |o| 0 || 0 || 0 || 0 } then it is better not to support marker pointing to the exact place of the error. (cherry picked from commit 076e3ea2a3ec121c62298a2b6ec9d4750b68bf05)
-rw-r--r--rpmio/expression.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rpmio/expression.c b/rpmio/expression.c
index 64715fa16..ad0199df5 100644
--- a/rpmio/expression.c
+++ b/rpmio/expression.c
@@ -130,6 +130,11 @@ typedef struct _parseState {
static void exprErr(const struct _parseState *state, const char *msg,
const char *p)
{
+ const char *newLine = strchr(state->str,'\n');
+
+ if (newLine && (*(newLine+1) != '\0'))
+ p = NULL;
+
rpmlog(RPMLOG_ERR, "%s: %s\n", msg, state->str);
if (p) {
int l = p - state->str + strlen(msg) + 2;