September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,22 @@
function common_directory_path(sequence paths, integer sep='/')
sequence res = {}
if length(paths) then
res = split(paths[1],sep)[1..-2]
for i=2 to length(paths) do
sequence pi = split(paths[i],sep)[1..-2]
for j=1 to length(res) do
if j>length(pi) or res[j]!=pi[j] then
res = res[1..j-1]
exit
end if
end for
if length(res)=0 then exit end if
end for
end if
return join(res,sep)
end function
constant test = {"/home/user1/tmp/coverage/test",
"/home/user1/tmp/covert/operator",
"/home/user1/tmp/coven/members"}
?common_directory_path(test)