diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2015-05-10 18:00:05 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-05-11 09:06:53 +0200 |
commit | ccbcfd79eca4d55692011d71911eb7efa7672e8d (patch) | |
tree | 4a2e99d858c28006b97d13c5df5ddc65f7f31a79 /util/kconfig/zconf.l | |
parent | 6be1a8bf084be82b19a561d475c5ad52d5fc987c (diff) | |
download | coreboot-ccbcfd79eca4d55692011d71911eb7efa7672e8d.tar.xz |
kconfig: handle globbed files backwards
They're essentially collected on a stack before they're
parsed. So we push them backwards, then parse them in
the correct order.
Change-Id: Ibf29559389cd19f260d67bae8e0b5ef9f4f58d91
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10169
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Diffstat (limited to 'util/kconfig/zconf.l')
-rw-r--r-- | util/kconfig/zconf.l | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/util/kconfig/zconf.l b/util/kconfig/zconf.l index e20d9c238e..b6bed02131 100644 --- a/util/kconfig/zconf.l +++ b/util/kconfig/zconf.l @@ -351,9 +351,14 @@ void zconf_nextfiles(const char *wildcard) return; } - w = g.gl_pathv; - while (*w) - zconf_nextfile(*w++); + /* working through files backwards, since + * we're first pushing them on a stack + * before actually handling them. + */ + for (i = g.gl_pathc; i > 0; i--) { + w = &g.gl_pathv[i - 1]; + zconf_nextfile(*w); + } globfree(&g); } |