syntheticpp/ninja — comment on commit ff7f0587dfc90bc2bc80365eff80f2a0835b791e
File:  line 0
By syntheticpp:

The reason for the if is: when the path starts with \ it could be longer than MAX_PATH (see the link),
but getting the first character could only be done if there is one, therefore !path.empty():
if (!path.empty() && path[0] != '\\' && path.size() > MAX_PATH) {

When the path is empty "if (!path.empty() " prevents the "Filename longer than" message.