NetBSD-Bugs archive

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

Re: bin/59956: gpt(8): show human-readable units



The following reply was made to PR bin/59956; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: Robert Elz <kre%munnari.OZ.AU@localhost>
Cc: gnats-bugs%netbsd.org@localhost, campbell+netbsd%mumble.net@localhost
Subject: Re: bin/59956: gpt(8): show human-readable units
Date: Wed, 4 Feb 2026 19:44:32 +0100

 On Thu, Feb 05, 2026 at 01:36:55AM +0700, Robert Elz wrote:
 > The one thing I worry about however is:
 > 
 >   | Label:	Backup_Root
 > 
 > Labels are just (UTF16 or whatever it is) text strings.
 > That means they can contain anything, including newlines, etc.
 > They can certainly contain spaces, though those alone - even leading
 > spaces, should be no real problem to handle.  But I think we need some
 > kind of encoding for this (to be properly parsable, rather than just
 > human readable) to deal with newlines, and other similar junk.
 
 I would just print all printable characters in the current locale
 and ignore all else. If the result does not fit in a WEDGE=... line
 in /etc/fstab later, things will break.
 
 If you prefer to encode, indeed vis(1)/vis(3) is quite convenient.
 
 > Everything else should be no problem (though I see no reason for
 > using tabs anywhere - except in the label if one is present there)
 > nor more than a single space between fields (and do you really need
 > both ',' and ' ' between the attribute names ? ... that's one where
 > I assume the names are easier to deal with than simply printing the
 > 64 bit field in hex).  This is not supposed to be pretty, just easy
 > for code to read and understand.
 
 No that, is not really needed - just what the exiting code accepts
 and trivial to adjust.
 
 Martin
 


Home | Main Index | Thread Index | Old Index