Skip to content
Snippets Groups Projects
Commit f763bca4 authored by andy's avatar andy
Browse files

BUG: #include of empty filename creates confusing error message (Mark Olesen)

When using #include or #includeIfPresent, it is easy to generate an
empty file name. For example,

    #include "~OpenFOAM/missing-path/file"

On error, findEtcFile() returns an empty fileName. This was treated as
a relative name, which meant there was an attempt to open the parent directory
as a file. The resulting error message was confusing:

    --> FOAM FATAL IO ERROR:
    Attempt to put back onto bad stream

    file: /CASE/PATH/system at line 1.

        From function void Istream::putBack(const token&)
        in file db/IOstreams/IOstreams/Istream.C at line 34.

- fix by leaving empty expansions as-is
parent bfafc1d7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment