[ffigen] Fix path normalization for absolute paths and globs starting with ** (#516)
diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index bd0617d..2861c65 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md
@@ -1,3 +1,7 @@ +# 7.2.6 + +- Fix path normalization behaviour for absolute paths and globs starting with `**`. + # 7.2.5 - Add support nested anonymous union/struct
diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index 176646e..8430c62 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart
@@ -32,8 +32,10 @@ /// path is passed in, it is resolved relative to the config path, and the /// absolute path is returned. String _normalizePath(String path, String? configFilename) { + final skipNormalization = + (configFilename == null) || p.isAbsolute(path) || path.startsWith("**"); return _replaceSeparators( - configFilename == null ? path : p.join(p.dirname(configFilename), path)); + skipNormalization ? path : p.join(p.dirname(configFilename), path)); } /// Checks if type of value is [T], logs an error if it's not.
diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 04b52ef..5dd77d4 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml
@@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.5 +version: 7.2.6 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen