[patch] Detecting batteries - need small change

Richard Hughes hughsient at gmail.com
Sat Sep 23 06:20:22 PDT 2006


me at trinity:~> cat /proc/acpi/battery/BAT*/info | grep "model number"
model number:            DELL Y13385

Now, the current code does:

hal_util_set_string_elem_from_file (d, "battery.model", path, "info",
				    "model number", 0, TRUE);

and hence:

battery.model = 'DELL'

I need to know the complete model number with the "Y13385".I propose
adding -1 to the elem section of hal_util_grep_string_elem_from_file to
mean "all of the line" rather than token x of the line.

Obviously, this only applies to string elements.

Patch is attached that should fix things. I can't test this directly but
it looks logically correct. Perhaps someone with a DELL could verify
this, although it's pretty trivial.

Good to commit?

Richard.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-fix-model.patch
Type: text/x-patch
Size: 1610 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20060923/4186493f/hal-fix-model.bin


More information about the hal mailing list