fixes #15942 [backport:1.2] [backport:1.4] (#16051)

(cherry picked from commit 1efd11e266)
This commit is contained in:
Andreas Rumpf
2020-11-19 13:42:16 +01:00
committed by narimiran
parent ff8fbb3001
commit 4ddb8feb93

View File

@@ -244,7 +244,7 @@ proc safeLineNm(info: TLineInfo): int =
proc genCLineDir(r: var Rope, filename: string, line: int; conf: ConfigRef) =
assert line >= 0
if optLineDir in conf.options:
if optLineDir in conf.options and line > 0:
r.addf("$N#line $2 $1$N",
[rope(makeSingleLineCString(filename)), rope(line)])