summaryrefslogtreecommitdiffstats
path: root/system/sleepd/fix_acpica_version.patch
blob: 02422ed0be755d831009e912c5da0e280a8311f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
diff -uNr sleepd-2.05.orig/acpi.c sleepd-2.05/acpi.c
--- sleepd-2.05.orig/acpi.c	2014-05-28 04:06:50.000000000 +0800
+++ sleepd-2.05/acpi.c	2020-07-17 22:51:39.340113991 +0800
@@ -67,7 +67,7 @@
 	fd = open(file, O_RDONLY);
 	if (fd == -1) return NULL;
 	end = read(fd, buf, sizeof(buf));
-	buf[end-1] = '\0';
+	((buf[end-1]) == '\n') && (buf[end-1] = '\0');
 	close(fd);
 	return buf;
 }