Closed bbx0 closed 1 year ago
Oh, boy! I forgot localization exists. Great catch, I'll merge and issue an immediate new patch release.
I find it very intriguing that the space between the number and unit is locale-dependent...
In addition invalid idle extraction, this also breaks the new code that searches for a literal "FROM" header, since the header names are localized as well.
All of these w
troubles could be replaced by directly parsing /var/run/utmp
instead, but that has platform-specific struct sizing, so it's not trivial to get it right either.
Thanks for picking this up so fast!
The spacing thing also got me off guard, I was just puzzled why those numbers would not line up.
It's almost like w
works against being. :) There is utmp-rs
but not sure about its usefulness here.
I noticed when a non-default locale is used the
FROM
header name inw
changes to the local language. Also the time format is different, which trips thew
time parsing (there is an additional space beforem
).As for root the locale is usually not changed this is likely not a problem. Still, I would provide
C
as the default to avoid unexpected changes in command outputs.