mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
fix for translating filenames beginning with numbers to C++ variable names
This commit is contained in:
parent
9d884c0285
commit
474a2edc98
1 changed files with 4 additions and 0 deletions
|
@ -206,6 +206,10 @@ string CPPCompile::BodyName(const FuncInfo& func)
|
|||
string fns = fn;
|
||||
transform(fns.begin(), fns.end(), fns.begin(), canonicalize);
|
||||
|
||||
if ( ! isalpha(fns[0]) )
|
||||
// This can happen for filenames beginning with numbers.
|
||||
fns = "_" + fns;
|
||||
|
||||
fname = fns + "__" + fname;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue