Fix path normalization for absolute paths and globs starting with ** (#516)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bd0617d..2861c65 100644
--- a/CHANGELOG.md
+++ b/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/lib/src/config_provider/spec_utils.dart b/lib/src/config_provider/spec_utils.dart
index 176646e..8430c62 100644
--- a/lib/src/config_provider/spec_utils.dart
+++ b/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/pubspec.yaml b/pubspec.yaml
index 04b52ef..5dd77d4 100644
--- a/pubspec.yaml
+++ b/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