From: Philipp Fent <fent@in.tum.de>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-efi <linux-efi@vger.kernel.org>
Subject: Re: [PATCH] efi/libstub: Fix path separator regression
Date: Mon, 15 Jun 2020 14:24:40 +0200 [thread overview]
Message-ID: <0ff1f982-6165-dfef-cada-e8da5c615cbf@in.tum.de> (raw)
In-Reply-To: <CAMj1kXGiG1opT8OyO-fN30YnrwAwSN6VttfhN5Hz1fMHd5EbVA@mail.gmail.com>
On 15.06.20 14:15, Ard Biesheuvel wrote:
>> ---
>> drivers/firmware/efi/libstub/file.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/firmware/efi/libstub/file.c b/drivers/firmware/efi/libstub/file.c
>> index 2005e33b33d5..f8a28a6e0bde 100644
>> --- a/drivers/firmware/efi/libstub/file.c
>> +++ b/drivers/firmware/efi/libstub/file.c
>> @@ -102,11 +102,21 @@ static int find_file_option(const efi_char16_t *cmdline, int cmdline_len,
>> if (!found)
>> return 0;
>>
>> + /* Skip any leading slashes */
>> + while (cmdline[i] == L'/' || cmdline[i] == L'\\')
>> + i++;
>> +
>> while (--result_len > 0 && i < cmdline_len) {
>> if (cmdline[i] == L'\0' ||
>> cmdline[i] == L'\n' ||
>> cmdline[i] == L' ')
>> break;
>> + /* Replace UNIX dir separators with EFI standard separators */
>> + if (cmdline[i] == L'/') {
>> + *result++ = L'\\';
>> + i++;
>> + continue;
>> + }
>
> Any objections if I change this to
>
>
> ---%<---
> efi_char16_t c = cmdline[i++];
>
> if (c == L'\0' || c == L'\n' || c == L' ')
> break;
> else if (c == L'/')
> /* Replace UNIX dir separators with EFI standard ones */
> *result++ = L'\\';
> else
> *result++ = c;
> ---%<---
>
>
> (no need to resend)
>
>
>> *result++ = cmdline[i++];
>> }
>> *result = L'\0';
>> --
>> 2.27.0
>>
Sure, go ahead. I wasn't sure about the style, but yours looks more terse.
Thanks for queueing as a fix!
prev parent reply other threads:[~2020-06-15 12:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-15 11:51 [PATCH] efi/libstub: Fix path separator regression Philipp Fent
2020-06-15 12:15 ` Ard Biesheuvel
2020-06-15 12:24 ` Philipp Fent [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ff1f982-6165-dfef-cada-e8da5c615cbf@in.tum.de \
--to=fent@in.tum.de \
--cc=ardb@kernel.org \
--cc=linux-efi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).