raster pushed a commit to branch master.
commit 4752435fe1d6aa62d4ecc064439412bbdcbc1d4c
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date: Tue May 21 01:25:19 2013 +0900
handle trailing newline from cpu governors so they get listed right.
---
src/modules/cpufreq/e_mod_main.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/modules/cpufreq/e_mod_main.c b/src/modules/cpufreq/e_mod_main.c
index a26fd95..9f8b15f 100644
--- a/src/modules/cpufreq/e_mod_main.c
+++ b/src/modules/cpufreq/e_mod_main.c
@@ -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
{
--
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d