Просмотр исходного кода

filetype/1 fix

Compaction of code
Andy 11 лет назад
Родитель
Сommit
cfddf43bc9
1 измененных файлов с 1 добавлено и 3 удалено
  1. 1 3
      src/mad_compile.erl

+ 1 - 3
src/mad_compile.erl

@@ -69,9 +69,7 @@ validate_property(Else, _) -> Else.
     fun((file:name(),string(),string(),list(tuple(any(),any())),string()) -> ok).
 compile_fun(Inc,Bin,Opt) -> fun(File) -> compile(File,Inc,Bin,Opt,filetype(File)) end.
 
-filetype(Path) ->
-    File = filename:basename(Path),
-    L=length(hd(string:tokens(File,"."))), string:substr(File, L + 1, length(File)).
+filetype(Path) -> "." ++ string:join(tl(string:tokens(filename:basename(Path), ".")), ".").
 
 compile(File,Inc,Bin,Opt,".yrl") ->
     ErlFile = yrl_to_erl(File),