| 51 | } |
| 52 | |
| 53 | txString fxCombinePath(txParser* parser, txString base, txString name) |
| 54 | { |
| 55 | txSize baseLength, nameLength; |
| 56 | txString path; |
| 57 | txString separator ; |
| 58 | #if mxWindows |
| 59 | separator = name; |
| 60 | while (*separator) { |
| 61 | if (*separator == '/') |
| 62 | *separator = '\\'; |
| 63 | separator++; |
| 64 | } |
| 65 | separator = strrchr(base, '\\'); |
| 66 | #else |
| 67 | separator = strrchr(base, '/'); |
| 68 | #endif |
| 69 | if (separator) { |
| 70 | separator++; |
| 71 | baseLength = mxPtrDiff(separator - base); |
| 72 | } |
| 73 | else |
| 74 | baseLength = 0; |
| 75 | nameLength = mxStringLength(name); |
| 76 | path = fxNewParserChunk(parser, baseLength + nameLength + 1); |
| 77 | if (baseLength) |
| 78 | c_memcpy(path, base, baseLength); |
| 79 | c_memcpy(path + baseLength, name, nameLength + 1); |
| 80 | return path; |
| 81 | } |
| 82 | |
| 83 | void fxDisposeParserChunks(txParser* parser) |
| 84 | { |
no test coverage detected