avoid using short lib names that clash with unix command names
This commit is contained in:
parent
da53d0fa10
commit
5d73a790e8
1 changed files with 2 additions and 3 deletions
|
@ -103,9 +103,8 @@ getLibName lib libmap = case M.lookup lib libmap of
|
|||
Just n -> (n, libmap)
|
||||
Nothing -> (nextfreename, M.insert lib nextfreename libmap)
|
||||
where
|
||||
names = map (\c -> [c]) letters ++
|
||||
[[l1, l2] | l1 <- letters, l2 <- letters]
|
||||
letters = ['a' .. 'z'] ++ ['0' .. '9']
|
||||
names = map (\c -> [c]) ['A' .. 'Z'] ++
|
||||
[[n, l] | n <- ['0' .. '9'], l <- ['A' .. 'Z']
|
||||
used = S.fromList $ M.elems libmap
|
||||
nextfreename = fromMaybe (error "ran out of short library names!") $
|
||||
headMaybe $ dropWhile (`S.member` used) names
|
||||
|
|
Loading…
Reference in a new issue