diff options
author | Lars Thorsen <[email protected]> | 2016-07-07 14:58:37 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2016-09-07 14:03:05 +0200 |
commit | cda114d8186af91f4fa18c5e549c85ffa3b5ea55 (patch) | |
tree | bd596511bd2d96e211ffd2d2a1cdf71920a6c125 /lib/snmp/src/compile/snmpc.erl | |
parent | 504b99b3dff501f8b4acd1c153f758723e66c2e2 (diff) | |
download | otp-cda114d8186af91f4fa18c5e549c85ffa3b5ea55.tar.gz otp-cda114d8186af91f4fa18c5e549c85ffa3b5ea55.tar.bz2 otp-cda114d8186af91f4fa18c5e549c85ffa3b5ea55.zip |
[snmp] Correct bug when path to mib contains UTF-8 characters
Diffstat (limited to 'lib/snmp/src/compile/snmpc.erl')
-rw-r--r-- | lib/snmp/src/compile/snmpc.erl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/snmp/src/compile/snmpc.erl b/lib/snmp/src/compile/snmpc.erl index db1f9ee61b..d86692aaf6 100644 --- a/lib/snmp/src/compile/snmpc.erl +++ b/lib/snmp/src/compile/snmpc.erl @@ -64,7 +64,7 @@ compile(Input, _Output, Options) -> {ok, _} -> ok; {error, Reason} -> - io:format("~p", [Reason]), + io:format("~tp", [Reason]), error end. @@ -126,7 +126,14 @@ compile(FileName) -> %%---------------------------------------------------------------------- compile(FileName, Options) when is_list(FileName) -> - true = snmpc_misc:is_string(FileName), + case snmpc_misc:check_file(FileName) of + true -> + compile_1(FileName, Options); + false -> + {error, {invalid_file, FileName}} + end. + +compile_1(FileName, Options) -> DefOpts = [{deprecated, true}, {group_check, true}, {i, ["./"]}, |