summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS8
-rw-r--r--parttypes.cc10
2 files changed, 13 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index bca65c0..ff54c6c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,11 @@
-1.0.5 (?/?/2019):
+1.0.5 (?/?/2020):
-----------------
-- Fixed minor typo in sgdisk man page
+- Fixed typos and minor formatting issues in man pages
+
+- Changed number of columns in type code output ("sgdisk -L" and equivalents
+ in gdisk and cgdisk) from 3 to 2, since some descriptions are long enough
+ that they're ambiguous with three columns.
1.0.4 (7/5/2018):
-----------------
diff --git a/parttypes.cc b/parttypes.cc
index cd225d1..5106f1b 100644
--- a/parttypes.cc
+++ b/parttypes.cc
@@ -20,6 +20,10 @@ int PartType::numInstances = 0;
AType* PartType::allTypes = NULL;
AType* PartType::lastType = NULL;
+#define SCREEN_WIDTH 80
+#define NUM_COLUMNS 2
+#define DESC_LENGTH (SCREEN_WIDTH - (6 * NUM_COLUMNS)) / NUM_COLUMNS
+
// Constructor. Its main task is to initialize the data list, but only
// if this is the first instance, since it's a static linked list.
// Partition type codes are MBR type codes multiplied by 0x0100, with
@@ -517,10 +521,10 @@ void PartType::ShowAllTypes(int maxLines) const {
cout.fill('0');
cout.width(4);
cout << hex << thisType->MBRType << " ";
- cout << thisType->name.substr(0, 20);
- for (i = 0; i < (20 - (thisType->name.substr(0, 20).length())); i++)
+ cout << thisType->name.substr(0, DESC_LENGTH);
+ for (i = 0; i < (DESC_LENGTH - (thisType->name.substr(0, DESC_LENGTH).length())); i++)
cout << " ";
- if ((colCount % 3) == 0) {
+ if ((colCount % NUM_COLUMNS) == 0) {
if (thisType->next) {
cout << "\n";
if ((maxLines > 0) && (lineCount++ % maxLines) == 0) {