IF sub
OR cp.subDirs.length # 0
THEN {
text: REF TEXT ← RefText.ObtainScratch[512];
pp: FSName.ParsedFName ~ FSName.ParseCacheName[Rope.Substr[fullFName, cp.dir.start, cp.dir.length], path, FALSE].pn;
volDesc: FSFileOps.VolumeDesc ~ pp.volDesc;
key: ROPE ← Rope.Concat[Rope.Substr[fullFName, cp.subDirs.start, cp.subDirs.length+1], IF sub THEN aaa ELSE zzz];
commonPrefixLength: NAT ← CommonPrefixLength[key, sub];
matchProc:
UNSAFE
PROC [entry: FSBackdoor.EntryPtr]
RETURNS [accept, stop:
BOOLEAN ←
FALSE] ~ {
name: LONG POINTER TO FSBackdoor.TextRep = @entry[entry.nameBody];
IF name.length > text.length THEN text ← NEW[TEXT[name.length]];
GetText[name, text];
IF text.length > 0 AND text[0] = '[ THEN {text.length ← 0; stop ← TRUE; RETURN};
IF text.length <= commonPrefixLength OR Rope.Run[s1: LOOPHOLE[text], s2: key, case: FALSE] < commonPrefixLength THEN {text.length ← 0; stop ← TRUE; RETURN};
stop ← Rope.Find[s1: LOOPHOLE[text], s2: ">", pos1: commonPrefixLength] >= 0;
};
newLength: NAT;
FSDir.EnumerateEntries[vDesc: volDesc, start: Rope.Flatten[key], versions: bangLOnly, matchProc: matchProc, acceptProc: NIL];
newLength ← MIN[commonPrefixLength, text.length];
WHILE newLength < text.length AND text[newLength] # '> DO newLength ← newLength+1 ENDLOOP;
IF newLength < text.length THEN newLength ← newLength+1;
text.length ← newLength;
WHILE text.length > 0 AND text[text.length-1] # '> DO text.length ← text.length - 1 ENDLOOP;
IF text.length <= commonPrefixLength OR Rope.Run[s1: LOOPHOLE[text], pos1: 0, s2: fullFName, pos2: cp.subDirs.start, case: FALSE] < commonPrefixLength THEN text.length ← 0;
IF text.length = Rope.Size[key]-1 AND Rope.Run[s1: LOOPHOLE[text], s2: key, case: FALSE] = text.length THEN text.length ← 0;
IF text.length > 0
THEN {
next ← Rope.Concat[Rope.Substr[fullFName, 0, cp.dir.start + cp.dir.length+1], Rope.FromRefText[text]];
};
RefText.ReleaseScratch[text];
};