Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -0,0 +1,9 @@
|
|||
# by Artyom Bologov
|
||||
H
|
||||
,p
|
||||
g/.*/s//&|/
|
||||
,j
|
||||
s/^([^|]*\/)[^|]*\|(\1[^|]*\|)*$/&: \1/
|
||||
s/\|/ /g
|
||||
,p
|
||||
Q
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
string 0; \use zero-terminated strings
|
||||
|
||||
func CommonPath(Separator, NumStrings, Strings); \Return common path string
|
||||
int Separator, NumStrings, Strings;
|
||||
char Str0, Str;
|
||||
int Char, I, J, K;
|
||||
|
||||
func CmpStrs; \Return index where strings don't match, or end
|
||||
[for I:= 0 to 1000 do
|
||||
[Char:= Str0(I); \get Char from first string
|
||||
if Char = 0 then return I;
|
||||
for J:= 1 to NumStrings-1 do
|
||||
[Str:= Strings(J);
|
||||
if Str(I) # Char then return I;
|
||||
];
|
||||
];
|
||||
];
|
||||
|
||||
[Str0:= Strings(0); \access individual bytes
|
||||
for K:= CmpStrs downto 0 do \search back from index
|
||||
if Str0(K) = Separator or Str0(K) = 0 then
|
||||
[Str0(K):= 0; \terminate first string at mismatch
|
||||
return Str0; \return address of common path string
|
||||
];
|
||||
];
|
||||
|
||||
[Text(0, CommonPath(^/, 3, ["/home/user1/tmp/coverage/test",
|
||||
"/home/user1/tmp/covert/operator",
|
||||
"/home/user1/tmp/coven/members"]));
|
||||
CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue