From: Stefan Weil <s...@weilnetz.de> When looking for the next directory component, a "." component is now skipped.
This fixes the path(s) used for firmware lookup for the prefix == bindir case which is standard for QEMU on Windows and where the internally used bindir value ends with "/.". Signed-off-by: Stefan Weil <s...@weilnetz.de> Message-Id: <20210208205752.2488774-1...@weilnetz.de> Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- util/cutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/cutils.c b/util/cutils.c index 0b5073b330..70c7d6efbd 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -916,7 +916,8 @@ static inline bool starts_with_prefix(const char *dir) static inline const char *next_component(const char *dir, int *p_len) { int len; - while (*dir && G_IS_DIR_SEPARATOR(*dir)) { + while ((*dir && G_IS_DIR_SEPARATOR(*dir)) || + (*dir == '.' && (G_IS_DIR_SEPARATOR(dir[1]) || dir[1] == '\0'))) { dir++; } len = 0; -- 2.29.2