| 104 | } |
| 105 | |
| 106 | static bool gf_absolute(const char *path) { |
| 107 | if (!path || !path[0]) |
| 108 | return false; |
| 109 | #ifdef _WIN32 |
| 110 | bool has_prefix = path[1] && path[2]; |
| 111 | bool drive = has_prefix && |
| 112 | ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && |
| 113 | path[1] == ':' && (path[2] == '/' || path[2] == '\\'); |
| 114 | bool unc = has_prefix && (path[0] == '/' || path[0] == '\\') && |
| 115 | (path[1] == '/' || path[1] == '\\') && path[2] != '/' && path[2] != '\\'; |
| 116 | return drive || unc; |
| 117 | #else |
| 118 | return path[0] == '/'; |
| 119 | #endif |
| 120 | } |
| 121 | |
| 122 | static bool gf_native_executable(const char *path) { |
| 123 | if (!gf_absolute(path)) |
no outgoing calls
no test coverage detected