MCPcopy Create free account
hub / github.com/IoLanguage/io / UArray_fileName

Function UArray_fileName

libs/basekit/source/UArray_path.c:95–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95UArray *UArray_fileName(UArray *self) {
96 // it looks like there is a memory stomping bug in this method...
97 long extPos = UArray_findLastPathComponent(self);
98 long dotPos = UArray_findPathExtension(self);
99
100 if (dotPos == -1 || dotPos < extPos) {
101 dotPos = self->size - 1;
102 }
103
104 return UArray_range(self, extPos, dotPos - extPos);
105}
106
107// to/from os path - always returns a copy
108

Callers 1

IoSeq_immutable.cFile · 0.85

Calls 3

UArray_findPathExtensionFunction · 0.85
UArray_rangeFunction · 0.85

Tested by

no test coverage detected