Page MenuHomeFreeBSD

vis.3: Try to better describe VIS_SAFE
ClosedPublic

Authored by des on Wed, Apr 29, 6:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 20, 1:44 AM
Unknown Object (File)
Sun, May 17, 9:37 AM
Unknown Object (File)
Sun, May 17, 5:08 AM
Unknown Object (File)
Sat, May 16, 7:10 PM
Unknown Object (File)
Sat, May 16, 3:07 AM
Unknown Object (File)
Sat, May 16, 12:19 AM
Unknown Object (File)
Thu, May 14, 5:08 PM
Unknown Object (File)
Tue, May 12, 2:21 PM
Subscribers

Details

Summary

The current text is correct, but fails to draw the reader's attention
to the fact that VIS_SAFE essentially works in reverse, i.e. it exempts
certain characters from being encoded.

While here, fix some markup nits.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Wed, Apr 29, 6:48 PM

@adrian could you perhaps look into getting this reviewed and committed upstream?

contrib/libc-vis/vis.3
297

Now I'm back to not understanding this flag. This text, and the old one, makes it sound like VIS_SAFE overrides other flags. But it doesn't:

$ hexdump -C space
00000000  20 0a                                             | .|
00000002
$ vis -s space

$ vis -w -s space
\040\012$

And looking at the implementation, it seems that VIS_SAFE just means "don't encode backspace, bell, and carriage return." Those characters are encoded by default.

302

It has no effect on space, tab, or newline.

contrib/libc-vis/vis.3
301

Graphic characters are not affected by this flag either.

This revision is now accepted and ready to land.Sun, May 3, 11:39 PM
This revision was automatically updated to reflect the committed changes.