| 158 | #define appendPath(dirPath, slot) _appendPath(the, dirPath, &slot) |
| 159 | |
| 160 | static char *_appendPath(xsMachine *the, char *dirPath, xsSlot *slot) |
| 161 | { |
| 162 | size_t dirLen = c_strlen(dirPath); |
| 163 | char *path = _getPath(the, slot); |
| 164 | char *result = fxNewChunk(the, dirLen + c_strlen(path) + 1); |
| 165 | path = xsmcToString(*slot); // refresh |
| 166 | c_strcpy(result, dirPath); |
| 167 | c_strcat(result, path); |
| 168 | size_t resultLen = c_strlen(result); |
| 169 | if ('/' == result[resultLen - 1]) |
| 170 | result[resultLen - 1] = 0; // remove trailing slash |
| 171 | return result; |
| 172 | } |
| 173 | |
| 174 | |
| 175 | /* |
nothing calls this directly
no test coverage detected