From 50a19e81a5ee38a9e4b279125fde961e12e5af3d Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 20 Jun 2012 17:28:26 +0000 Subject: Fixed patition names for solaris --- fdisk/cfdisk.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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")); -- cgit v1.2.3