September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -0,0 +1,26 @@
|
|||
# Project : Find common directory path
|
||||
# Author : Gal Zsolt (~ CalmoSoft ~)
|
||||
# Email : <calmosoft@gmail.com>
|
||||
|
||||
load "stdlib.ring"
|
||||
i = null
|
||||
o = null
|
||||
path = list(3)
|
||||
|
||||
path[1] = "/home/user1/tmp/coverage/test"
|
||||
path[2] = "/home/user1/tmp/covert/operator"
|
||||
path[3] = "/home/user1/tmp/coven/members"
|
||||
|
||||
see commonpath(path, "/")
|
||||
|
||||
func commonpath(p, s)
|
||||
while i != 0
|
||||
o = i
|
||||
i = substring(p[1], s, i+1)
|
||||
for j = 2 to len(p)
|
||||
if left(p[1], i) != left(p[j], i)
|
||||
exit 2
|
||||
ok
|
||||
next
|
||||
end
|
||||
return left(p[1], o-1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue