summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-06-20 17:28:26 +0000
committerIgor Pashev <pashev.igor@gmail.com>2012-06-20 17:28:26 +0000
commit50a19e81a5ee38a9e4b279125fde961e12e5af3d (patch)
treeeafb40f642ff1e0c1ae7099bae461a85505cc7f9
parentb44b04b0c5a7f29ec6d0d5424bb8757629d5902b (diff)
downloadutil-linux-old-50a19e81a5ee38a9e4b279125fde961e12e5af3d.tar.gz
Fixed patition names for solaris
-rw-r--r--fdisk/cfdisk.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index ae1f50a1..5ee14d39 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -2459,11 +2459,19 @@ draw_partition(int i) {
if (p_info[i].id > 0) {
char *dbn = my_basename(disk_device);
int l = strlen(dbn);
- int digit_last = isdigit(dbn[l-1]);
+#ifdef __sun__
+ /* XXX: Whole disk is c0t0d0p0, but patitions are c0t0d0p1, c0t0d0p2, etc */
+ dbn[l-1] = '\0'; /* Cutoff '0' */
+ mvprintw(y, NAME_START,
+ "%s%d", dbn, p_info[i].num+1);
+ dbn[l-1] = '0'; /* Restore '0' */
+#else
+ int digit_last = isdigit(dbn[l-1]);
mvprintw(y, NAME_START,
"%s%s%d", dbn, (digit_last ? "p" : ""),
p_info[i].num+1);
+#endif
if (p_info[i].flags) {
if (p_info[i].flags == ACTIVE_FLAG)
mvaddstr(y, FLAGS_START, _("Boot"));