properly get lid status! my god this has been broken for a while!

SVN revision: 67602
This commit is contained in:
Carsten Haitzler 2012-01-30 12:58:40 +00:00
parent 9ba038d504
commit 16022b1d80
1 changed files with 5 additions and 2 deletions

View File

@ -329,10 +329,13 @@ _e_acpi_lid_status_get(const char *device, const char *bus)
i = 0;
while (buff[i] != ':') i++;
while (!isalnum(buff[i])) i++;
ret = &(buff[i]);
while (isalnum(buff[i])) i++;
buff[i] = 0;
/* compare value from state file and return something sane */
if (!strcmp(buff, "open")) return E_ACPI_LID_OPEN;
else if (!strcmp(buff, "closed")) return E_ACPI_LID_CLOSED;
if (!strcmp(ret, "open")) return E_ACPI_LID_OPEN;
else if (!strcmp(ret, "closed")) return E_ACPI_LID_CLOSED;
else return E_ACPI_LID_UNKNOWN;
}