| 85 | #define appendPath(dirPath, slot) _appendPath(the, dirPath, &slot) |
| 86 | |
| 87 | static char *_appendPath(xsMachine *the, char *dirPath, xsSlot *slot) |
| 88 | { |
| 89 | size_t dirLen = c_strlen(dirPath); |
| 90 | char *path = _getPath(the, slot); |
| 91 | char *result = fxNewChunk(the, dirLen + 1 + c_strlen(path) + 1); |
| 92 | path = xsmcToString(*slot); // refresh |
| 93 | c_strcpy(result, dirPath); |
| 94 | c_strcat(result, "/"); |
| 95 | c_strcat(result, path); |
| 96 | size_t resultLen = c_strlen(result); |
| 97 | if ('/' == result[resultLen - 1]) |
| 98 | result[resultLen - 1] = 0; // remove trailing slash |
| 99 | return result; |
| 100 | } |
| 101 | |
| 102 | /* |
| 103 | File |
nothing calls this directly
no test coverage detected