mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 04:33:23 +00:00
Terminate the output directory argument of flatc.
Given the command flatc -o . -c test.fbs it would generate header file .test_generated.h rather than ./test_generated.h This fixes this issue. Tested: Manually verified that flatc generates the correct output files given output paths ending with and without '/' on Linux and Windows. Bug: 16464827 Change-Id: I854cb881286f22690f1885f942cf3fd2fc59ca8d
This commit is contained in:
@@ -134,6 +134,10 @@ int main(int argc, const char *argv[]) {
|
||||
case 'o':
|
||||
if (++i >= argc) Error("missing path following", arg, true);
|
||||
output_path = argv[i];
|
||||
if (!(output_path.back() == flatbuffers::kPathSeparator ||
|
||||
output_path.back() == flatbuffers::kPosixPathSeparator)) {
|
||||
output_path += flatbuffers::kPathSeparator;
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
opts.strict_json = true;
|
||||
@@ -212,4 +216,3 @@ int main(int argc, const char *argv[]) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user