Skip to content

Commit be43409

Browse files
marek-trtikpeterschrammel
authored andcommitted
File-util-normalise-path: don't throw
1 parent fc2d511 commit be43409

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/file_util.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ std::string fileutl_normalise_path(std::string const& path)
286286
{
287287
assert(pos != 0ULL);
288288
const std::string::size_type prev_pos = result.rfind("/",pos-1ULL);
289-
assert(pos != std::string::npos);
289+
if(prev_pos == std::string::npos)
290+
break;
290291
result.replace(prev_pos,pos - prev_pos + 4ULL,"/");
291292
}
292293
return result;

0 commit comments

Comments
 (0)