handle trailing newline from cpu governors so they get listed right.

This commit is contained in:
Carsten Haitzler 2013-05-21 01:25:19 +09:00
parent 74d23ebd80
commit 4752435fe1
1 changed files with 12 additions and 2 deletions

View File

@ -679,7 +679,8 @@ _cpufreq_status_check_available(Status *s)
if (f)
{
char *gov;
int len;
if (s->governors)
{
for (l = s->governors; l; l = l->next)
@ -694,7 +695,16 @@ _cpufreq_status_check_available(Status *s)
return;
}
fclose(f);
len = strlen(buf);
if (len > 0)
{
gov = buf + len - 1;
while ((gov > buf) && (isspace(*gov)))
{
*gov = 0;
gov--;
}
}
gov = strtok(buf, " ");
do
{