summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/flex/flex/0001-Emit-no-line-directives-if-gen_line_dirs-is-false.patch
blob: c8202b6bd5ed8235326a51ba6940119d29d811ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 440f3f55739468cd26e22f31871eca8cbbd53294 Mon Sep 17 00:00:00 2001
From: Oleksiy Obitotskyy <oobitots@cisco.com>
Date: Wed, 6 Jan 2021 06:12:14 -0800
Subject: [PATCH] Emit no #line directives if gen_line_dirs is false

If we set --noline we should not print line directives.
But setting --noline means gen_line_dirs is false.

Upstream-Status: Submitted
Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
---
 src/buf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/buf.c b/src/buf.c
index 185083c..4439e28 100644
--- a/src/buf.c
+++ b/src/buf.c
@@ -95,8 +95,8 @@ struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno)
     const char *src;
     size_t tsz;
 
-    if (gen_line_dirs)
-	return buf;
+    if (!gen_line_dirs)
+        return buf;
 
     tsz = strlen("#line \"\"\n")                +   /* constant parts */
                2 * strlen (filename)            +   /* filename with possibly all backslashes escaped */
-- 
2.26.2.Cisco