diff --git a/docs/reference/girepository/migrating-gi.md b/docs/reference/girepository/migrating-gi.md index 8e8175517..5f3a4e59d 100644 --- a/docs/reference/girepository/migrating-gi.md +++ b/docs/reference/girepository/migrating-gi.md @@ -91,6 +91,12 @@ your code if integer type warnings are enabled. | `g-ir-generate` | `gi-decompile-typelib` | | `g-ir-inspect` | `gi-inspect-typelib` | -In addition, the `--version` option for `g-ir-inspect` has been renamed to +In addition, some command-line options have been changed. + +The `--version` option for `g-ir-inspect` has been renamed to `--typelib-version` in `gi-inspect-typelib`. +The `--includedir` option to `gi-decompile-typelib` treats the +given directories as most-important-first, consistent with +`gi-compile-repository --includedir` and `gcc -I`. +`g-ir-generate` treated `--includedir` options as least-important-first. diff --git a/girepository/decompiler/decompiler.c b/girepository/decompiler/decompiler.c index 821b8ae58..0d9fbe21b 100644 --- a/girepository/decompiler/decompiler.c +++ b/girepository/decompiler/decompiler.c @@ -87,8 +87,13 @@ main (int argc, char *argv[]) repository = gi_repository_new (); if (includedirs != NULL) - for (i = 0; includedirs[i]; i++) - gi_repository_prepend_search_path (repository, includedirs[i]); + { + guint n = g_strv_length (includedirs); + guint j; + + for (j = 1; j <= n; j++) + gi_repository_prepend_search_path (repository, includedirs[n - j]); + } for (i = 0; input[i]; i++) {