mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: bad '#line' directives for dynamicCode (fixes #1282)
- now suppress any '#line' if the input number number is invalid (ie, an empty set of tokens)
This commit is contained in:
committed by
Andrew Heather
parent
53d01c8a0a
commit
cd7748f8e4
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd |
|
||||
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -124,11 +124,16 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
|
||||
void Foam::dynamicCodeContext::addLineDirective
|
||||
(
|
||||
string& code,
|
||||
const label lineNum,
|
||||
label lineNum,
|
||||
const fileName& name
|
||||
)
|
||||
{
|
||||
code = "#line " + Foam::name(lineNum + 1) + " \"" + name + "\"\n" + code;
|
||||
++lineNum; // Change from 0-based to 1-based
|
||||
|
||||
if (lineNum > 0 && !name.empty())
|
||||
{
|
||||
code = "#line " + Foam::name(lineNum) + " \"" + name + "\"\n" + code;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user