[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/19] util/cutils: Skip "." when looking for next directory compo
From: |
Paolo Bonzini |
Subject: |
[PULL 14/19] util/cutils: Skip "." when looking for next directory component |
Date: |
Mon, 15 Feb 2021 14:16:21 +0100 |
From: Stefan Weil <sw@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 <sw@weilnetz.de>
Message-Id: <20210208205752.2488774-1-sw@weilnetz.de>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@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
- [PULL 05/19] sev/i386: Allow AP booting under SEV-ES, (continued)
- [PULL 05/19] sev/i386: Allow AP booting under SEV-ES, Paolo Bonzini, 2021/02/15
- [PULL 06/19] sev/i386: Don't allow a system reset under an SEV-ES guest, Paolo Bonzini, 2021/02/15
- [PULL 07/19] kvm/i386: Use a per-VM check for SMM capability, Paolo Bonzini, 2021/02/15
- [PULL 10/19] libqos/qgraph_internal: add qos_printf() and qos_printf_literal(), Paolo Bonzini, 2021/02/15
- [PULL 08/19] sev/i386: Enable an SEV-ES guest based on SEV policy, Paolo Bonzini, 2021/02/15
- [PULL 09/19] libqos/qgraph: add qos_node_create_driver_named(), Paolo Bonzini, 2021/02/15
- [PULL 11/19] tests/qtest/qos-test: dump qos graph if verbose, Paolo Bonzini, 2021/02/15
- [PULL 13/19] tests/qtest/qos-test: dump QEMU command if verbose, Paolo Bonzini, 2021/02/15
- [PULL 12/19] tests/qtest/qos-test: dump environment variables if verbose, Paolo Bonzini, 2021/02/15
- [PULL 14/19] util/cutils: Skip "." when looking for next directory component,
Paolo Bonzini <=
- [PULL 17/19] hvf: x86: Remove unused definitions, Paolo Bonzini, 2021/02/15
- [PULL 15/19] hvf: Guard xgetbv call, Paolo Bonzini, 2021/02/15
- [PULL 16/19] target/i386/hvf: add vmware-cpuid-freq cpu feature, Paolo Bonzini, 2021/02/15
- [PULL 18/19] target/i386/hvf: add rdmsr 35H MSR_CORE_THREAD_COUNT, Paolo Bonzini, 2021/02/15
- [PULL 19/19] hvf: Fetch cr4 before evaluating CPUID(1), Paolo Bonzini, 2021/02/15
- Re: [PULL 00/19] i386, qgraph patches for 2020-02-15, Thomas Huth, 2021/02/15
- Re: [PULL 00/19] i386, qgraph patches for 2020-02-15, Philippe Mathieu-Daudé, 2021/02/15
- Re: [PULL 00/19] i386, qgraph patches for 2020-02-15, no-reply, 2021/02/15
- Re: [PULL 00/19] i386, qgraph patches for 2020-02-15, Eric Blake, 2021/02/15