GobySoft / dccl

Dynamic Compact Control Language
Other
17 stars 13 forks source link

Fixes file not found when passing relative paths including ".." to the dccl tool #4

Closed tsaubergine closed 8 years ago

tsaubergine commented 8 years ago

Bug is that --proto_file arguments with relative ".." path components are not found even though they exist:

./dccl --analyze --proto_file ../src/test/dccl_all_fields/test.proto
terminate called after throwing an instance of 'dccl::Exception'
  what():  File: ../src/test/dccl_all_fields/test.proto has error (line: -1, column: 0):File not found.
zsh: abort (core dumped)  ./dccl --analyze --proto_file ../src/test/dccl_all_fields/test.proto

This pull request fixes that by canonicalizing the --proto_file (-f) arguments before passing to the DynamicProtobufManager (which passes them to libprotoc).

 ./dccl --analyze --proto_file ../src/test/dccl_all_fields/test.proto
...
||||||| Dynamic Compact Control Language (DCCL) Codec |||||||
1 messages loaded.
Field sizes are in bits unless otherwise noted.
==================== 2: dccl.test.TestMsg ====================
...