This code is used to read data copied from /etc/os-release. According to
the spec[1], values can be enclosed in single quotes or double quotes.
Not handling single quotes results in the quotes appearing in the
systemd-boot menu, e.g. 'Gentoo Linux'.
[1] https://www.freedesktop.org/software/systemd/man/latest/os-release.html
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
value++;
/* unquote */
- if (value[0] == '"' && line[linelen - 1] == '"') {
+ if ((value[0] == '"' && line[linelen - 1] == '"') ||
+ (value[0] == '\'' && line[linelen - 1] == '\'')) {
value++;
line[linelen - 1] = '\0';
}