[BusyBox-cvs] busybox/util-linux fdisk.c,1.9,1.10

Erik Andersen andersen at busybox.net
Fri Aug 8 20:04:59 UTC 2003


Update of /var/cvs/busybox/util-linux
In directory winder:/tmp/cvs-serv25801/util-linux

Modified Files:
	fdisk.c 
Log Message:
Patch from Kent Robotti to being fdisk in sync with v2.12 final.


Index: fdisk.c
===================================================================
RCS file: /var/cvs/busybox/util-linux/fdisk.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- fdisk.c	6 Aug 2003 09:07:37 -0000	1.9
+++ fdisk.c	8 Aug 2003 20:04:56 -0000	1.10
@@ -10,7 +10,7 @@
  * Vladimir Oleynik <dzo at simtreas.ru> 2001,2002 Busybox port
  */
 
-#define UTIL_LINUX_VERSION "2.12pre"
+#define UTIL_LINUX_VERSION "2.12"
 
 #define PROC_PARTITIONS "/proc/partitions"
 
@@ -1925,11 +1925,9 @@
 
 static void
 sgi_list_table(int xtra) {
-    int i, w;
+    int i, w, wd;
     int kpi = 0;                /* kernel partition ID */
 
-    w = strlen(disk_device);
-
     if(xtra) {
 	printf(_("\nDisk %s (SGI disk label): %d heads, %d sectors\n"
 	       "%d cylinders, %d physical cylinders\n"
@@ -1949,9 +1947,15 @@
 		disk_device, heads, sectors, cylinders,
 		str_units(PLURAL), units_per_sector );
     }
+
+    w = strlen(disk_device);
+    wd = strlen(_("Device"));
+    if (w < wd)
+	w = wd;
+
     printf(_("----- partitions -----\n"
 	   "Pt# %*s  Info     Start       End   Sectors  Id  System\n"),
-	   w + 1, _("Device"));
+	    w + 2, _("Device"));
     for (i = 0 ; i < partitions; i++) {
 	    if( sgi_get_num_sectors(i) || debug ) {
 	    uint32_t start = sgi_get_start_sector(i);
@@ -1960,7 +1964,7 @@
 	    printf(
 		"%2d: %s %4s %9ld %9ld %9ld  %2x  %s\n",
 /* fdisk part number */   i+1,
-/* device */              partname(disk_device, kpi, w+2),
+/* device */              partname(disk_device, kpi, w+3),
 /* flags */               (sgi_get_swappartition() == i) ? "swap" :
 /* flags */               (sgi_get_bootpartition() == i) ? "boot" : "    ",
 /* start */               (long) scround(start),




More information about the busybox-cvs mailing list