* @brief Resolves an include file path to a full absolute path * * @param IncludeFilePath the include file path (relative or absolute) * @param OutPath the buffer to receive the resolved path * @return VOID */
| 118 | * @return VOID |
| 119 | */ |
| 120 | VOID |
| 121 | ResolveIncludePath(const char * IncludeFilePath, char * OutPath) |
| 122 | { |
| 123 | if (IsAbsolutePath(IncludeFilePath)) |
| 124 | { |
| 125 | strncpy(OutPath, IncludeFilePath, MAX_PATH_LEN - 1); |
| 126 | OutPath[MAX_PATH_LEN - 1] = '\0'; |
| 127 | return; |
| 128 | } |
| 129 | |
| 130 | CHAR ExeDir[MAX_PATH_LEN]; |
| 131 | GetModuleFileNameA(NULL, ExeDir, MAX_PATH_LEN); |
| 132 | |
| 133 | char * P = strrchr(ExeDir, '\\'); |
| 134 | if (P) |
| 135 | *P = '\0'; |
| 136 | |
| 137 | snprintf( |
| 138 | OutPath, |
| 139 | MAX_PATH_LEN, |
| 140 | "%s\\%s", |
| 141 | ExeDir, |
| 142 | IncludeFilePath); |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * @brief Checks whether a file exists at the given path |
no test coverage detected