mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Reduce some false-positive warnings from GCC to warnings with -Werror
This also works around some of the same warnings. These are known bugs in GCC 11+ and GCC 13.x.
This commit is contained in:
parent
cd356ce45d
commit
57a3c733d1
6 changed files with 30 additions and 22 deletions
|
@ -121,15 +121,15 @@ bool Ascii::OpenFile() {
|
|||
fname = Info().source;
|
||||
|
||||
if ( fname.front() != '/' && ! path_prefix.empty() ) {
|
||||
string path = path_prefix;
|
||||
std::size_t last = path.find_last_not_of('/');
|
||||
std::size_t last = path_prefix.find_last_not_of('/');
|
||||
|
||||
string path;
|
||||
if ( last == string::npos ) // Nothing but slashes -- weird but ok...
|
||||
path = "/";
|
||||
else
|
||||
path.erase(last + 1);
|
||||
path = path_prefix.substr(0, last + 1);
|
||||
|
||||
fname = path + "/" + fname;
|
||||
fname = util::fmt("%s/%s", path.c_str(), fname.c_str());
|
||||
}
|
||||
|
||||
file.open(fname);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue