Running "acpiconf -i 0" produces the following output on my laptop (fresh 10.0-RELEASE install, as well as 10.0-p8): http://ix.io/elA ; http://sprunge.us/CNCN ; Note the extra whitespace after the "State:" line, L13. It is only an annoyance because it breaks the switch/case syntax in shell scripts. I suspect the behavior is the same when "discharging" (can't test right now though, as I'm working on a remote machine).
Please see https://reviews.freebsd.org/D2243
Created attachment 155290 [details] A patch to test
(In reply to John Baldwin from comment #1) I am okay with your patch. However, I'd like to clearly note that other states are invalid. Please let me know what you think.
Comment on attachment 155290 [details] A patch to test Hah, I actually started with something like this myself but worried it was too verbose. I'm fine with this approach though. The only thing I would suggest is outputting the raw hex value for invalid values. You could do that by using printf() instead of the state variable.
(In reply to John Baldwin from comment #4) No, it is not necessary because practically there is only one invalid value, i.e., ACPI_BATT_STAT_DISCHARG | ACPI_BATT_STAT_CHARGING. :-)
A commit references this bug: Author: jkim Date: Mon Apr 6 21:51:55 UTC 2015 New revision: 281171 URL: https://svnweb.freebsd.org/changeset/base/281171 Log: Tidy up battery status information. Remove a trailing white space. PR: 193671 Changes: head/usr.sbin/acpi/acpiconf/acpiconf.c
(In reply to Jung-uk Kim from comment #5) Ah, I had originally complained if any reserved bits were set as well, but your patch is fine.
A commit references this bug: Author: jkim Date: Sat Apr 11 01:17:22 UTC 2015 New revision: 281389 URL: https://svnweb.freebsd.org/changeset/base/281389 Log: MFC: r281171 Tidy up battery status information. Remove a trailing white space. PR: 193671 Changes: _U stable/10/ stable/10/usr.sbin/acpi/acpiconf/acpiconf.c _U stable/8/usr.sbin/acpi/acpiconf/ stable/8/usr.sbin/acpi/acpiconf/acpiconf.c _U stable/9/usr.sbin/acpi/acpiconf/ stable/9/usr.sbin/acpi/acpiconf/acpiconf.c