let filename_concat x y =
  if x = Filename.current_dir_name || x = "" then y else
  if x.[String.length x - 1] = '/' then
    if y = "" then x
    else x ^ y
  else x ^ "/" ^ y