Thread (5 messages) 5 messages, 4 authors, 2020-09-01

RE: sysfs output without newlines

From: David Laight <hidden>
Date: 2020-09-01 09:09:08
Also in: linux-arm-kernel, linux-edac, linux-i3c, linux-mmc, linux-scsi, linux-spi, linux-usb, linux-wireless, lkml, platform-driver-x86

From: Joe Perches
Sent: 29 August 2020 21:34
...
quoted
On 8/29/20 9:23 PM, Joe Perches wrote:
quoted
While doing an investigation for a possible treewide conversion of
sysfs output using sprintf/snprintf/scnprintf, I discovered
several instances of sysfs output without terminating newlines.

It seems likely all of these should have newline terminations
or have the \n\r termination changed to a single newline.
I think that it could break badly written scripts in rare cases.
Maybe.

Is sysfs output a nominally unchangeable api like seq_?
Dunno.  seq_ output is extended all the time.

I think whitespace isn't generally considered part of
sscanf type input content awareness.
The shell will remove trailing '\n' (but not '\r') from:
	foo=$(cat bar)
So shell scripts are unlikely to be affected.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help