--- battstat/acpi-linux.c~	2004-02-05 11:48:11.677642736 +0700
+++ battstat/acpi-linux.c	2004-02-05 12:29:43.735792312 +0700
@@ -330,13 +330,17 @@
  * by select(). */
 gboolean acpi_process_event(struct acpi_info * acpiinfo)
 {
-    int i;
+    int i = 0;
     int evt;
     char * s;
     char str[256];
     gboolean result = FALSE;
 
-    i = read(acpiinfo->event_fd, str, sizeof(str)-1);
+    while (i < sizeof(str)-1 && read(acpiinfo->event_fd, str+i, 1) == 1) {
+      if (str[i++] == '\n')
+	break;
+    }
+
     str[i] = '\0';
     s = str;
     while ((evt = parse_acpi_event(s, &s)) != ACPI_EVENT_DONE) {
