File pdisk.hfs-dump-format.patch of Package pdisk

put the HFS volume name in single quotes
remove ' char from HFS volume name

 dump.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

Index: pdisk/dump.c
===================================================================
--- pdisk.orig/dump.c
+++ pdisk/dump.c
@@ -240,7 +240,7 @@ dump_partition_map(partition_map_header 
     }
     printf(" #: %*s %-*s %*s   %-*s ( size )\n",
 	    max_type_length, "type",
-	    max_name_length, "name",
+	    max_name_length + 2, "name",
 	    digits, "length", digits, "base");
 
     if (disk_order) {
@@ -286,7 +286,7 @@ dump_partition_entry(partition_map *entr
 	}
 	printf("%2ld: %.4s", entry->disk_address, s);
     } else {
-	printf("%2ld: %*.32s", entry->disk_address, type_length, p->dpme_type);
+	printf("%2ld: %*.27s", entry->disk_address, type_length, p->dpme_type);
     }
 
     buf = (char *) malloc(name_length+1);
@@ -294,9 +294,12 @@ dump_partition_entry(partition_map *entr
 	strncpy(buf, p->dpme_name, name_length);
 	buf[name_length] = 0;
     } else {
-	sprintf(buf, "\"%s\"", entry->HFS_name);
+	sprintf(buf, "%s", entry->HFS_name);
     }
-    printf("%c%-*.32s ", driver, name_length, buf);
+    for (j = 0; buf[j] ; j++)
+	    if (buf[j] == '\'')
+		    buf[j] = ' ';
+    printf("%c'%-*.27s' ", driver, name_length, buf);
     free(buf);
     /*
     switch (entry->HFS_kind) {
@@ -843,7 +846,7 @@ get_max_name_string_length(partition_map
 		if (entry->HFS_name == NULL) {
 		    length = 0;
 		} else {
-		    length = strlen(entry->HFS_name) + 2;
+		    length = strlen(entry->HFS_name);
 		}
 		if (length > max) {
 		    max = length;
openSUSE Build Service is sponsored by