[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

\r not escaped in e.g. /proc/mounts



Hey.

Wanted to ask here, before I make (probably unnecessary noise at
lkml).. O:-)


I just noticed that \r is not escaped in e.g. /proc/mounts (and
possibly similar files that do such escaping).


The output does in fact contain then a \r, so I guess parsing for most
(all?) shell tools should be fine... and this be a non issue.

But on the terminal, things get messed up and not necessarily in a
noticeable way.

Consider e.g.
# mkdir $'a\rb'
# mount -t tmpfs bar $'a\rb'
# grep bar /proc/mounts 
b tmpfs rw,relatime,inode64 0 0x/a
(as seen on the terminal)

instead of a mount with $'c\rd':
foo /root/strange-mount-points/c\012d tmpfs rw,relatime,inode64 0 0


Cheers,
Chris.


Reply to: