From f6f4c904fa4be101af87fc4820f212afd816b06a Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 9 Jul 2026 23:20:02 +0400 Subject: [PATCH] fixing os name parsing from /etc/os-release for single-quoted values gentoo (and possibly others) write ID='gentoo' with single quotes in /etc/os-release. ParseOsRelease was only stripping double quotes and using ascii comparison to find the end of the value, which caused single quotes to be embedded in the os string, producing invalid oberon like os* = ''gentoo''. stripping both quote styles at start and stopping at either kind at end. works for unquoted values (raspbian, devuan) and double-quoted values too. --- src/tools/make/configure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 258a1b4e..6089d1fc 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -74,9 +74,9 @@ void ParseOsRelease(FILE *fd) { while (fgets(osrelease, sizeof(osrelease), fd) != NULL) { if (strncasecmp(osrelease, "id=", 3) == 0) { int i=3; - while (osrelease[i] == '"') {i++;} + while (osrelease[i] == '"' || osrelease[i] == '\'') {i++;} int j=i; - while (osrelease[j] > '"') {j++;} + while (osrelease[j] != 0 && osrelease[j] != '\n' && osrelease[j] != '"' && osrelease[j] != '\'') {j++;} if (j>i) { osrelease[j] = 0; os = osrelease + i;