[Parted-commits] GNU Parted Official Repository: Changes to 'debian/master'

Otavio Salvador otavio at alioth.debian.org
Wed Jun 4 13:33:35 UTC 2008


 debian/changelog                         |   19 +++++++++
 debian/control.in                        |   18 +--------
 libparted/arch/linux.c                   |    4 +-
 libparted/exception.c                    |   10 ++---
 libparted/fs/ext2/ext2_block_relocator.c |    9 ++--
 libparted/fs/ext2/ext2_mkfs.c            |    4 +-
 libparted/fs/fat/resize.c                |    6 +--
 libparted/fs/fat/traverse.c              |    2 -
 libparted/fs/fat/traverse.h              |    3 +
 libparted/labels/dos.c                   |   16 ++++----
 libparted/labels/mac.c                   |   14 +++----
 parted/parted.c                          |   36 +++++++++---------
 parted/ui.c                              |   10 ++---
 parted/ui.h                              |    4 +-
 tests/Makefile.am                        |    1 
 tests/t2200-dos-label-recog.sh           |   61 +++++++++++++++++++++++++++++++
 16 files changed, 144 insertions(+), 73 deletions(-)

New commits:
commit aa25b306f7cb0d66360ed20bc76eda6405e78825
Author: Otavio Salvador <otavio at ossystems.com.br>
Date:   Tue Jun 3 19:26:34 2008 -0300

    Release 1.8.8.git.2008.03.24-6

diff --git a/debian/changelog b/debian/changelog
index 31b1378..1205454 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+parted (1.8.8.git.2008.03.24-6) experimental; urgency=low
+
+  [ Otavio Salvador ]
+  * Give the parted udeb a menu item number. This allows it to be
+    selected manually in anna. Update the udeb description for
+    consistency and remove the long description to save space. Thanks to
+    Frans Pop <elendil at planet.nl> (closes: #466826).
+
+  [ Jim Meyering ]
+  * test for improved DOS-partition-table recognition
+
+  [ Colin Watson ]
+  * bug fix: improve DOS partition table recognition
+
+  [ Jim Meyering ]
+  * avoid const-related compiler warnings
+
+ -- Otavio Salvador <otavio at ossystems.com.br>  Tue, 03 Jun 2008 19:25:27 -0300
+
 parted (1.8.8.git.2008.03.24-5) experimental; urgency=low
 
   * Disable LVM support for dasd labels

commit ed69d5e48fa07af68db31924405df9499623e11a
Author: Otavio Salvador <otavio at ossystems.com.br>
Date:   Tue Jun 3 19:22:36 2008 -0300

    Give the parted udeb a menu item number. This allows it to be selected manually in anna. Update the udeb description for consistency and remove the long description to save space. Thanks to Frans Pop <elendil at planet.nl> (closes: #466826).

diff --git a/debian/control.in b/debian/control.in
index f74b765..6191f37 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -44,23 +44,9 @@ XC-Package-Type: udeb
 Architecture: any
 Section: debian-installer
 Priority: extra
+XB-Installer-Menu-Item: 99999
 Depends: ${shlibs:Depends}
-Description: The GNU Parted disk partition resizing program
- GNU Parted is a program that allows you to create, destroy,
- resize, move and copy hard disk partitions. This is useful
- for creating space for new operating systems, reorganising
- disk usage, and copying data to new hard disks. This package
- contains the Parted binary and manual page.
- .
- This package is similar to the "big" parted package, but has
- less cosmetical features resulting in smaller binary. Intended 
- to be used in debian-installer.     
- .
- .
- The nature of this software means that any bugs could cause
- massive data loss. While there are no known bugs at the moment,
- they could exist, so please back up all important files before
- running it, and do so at your own risk.
+Description: Manually partition a hard drive (parted)
 
 Package: libparted at SHAREDLIBPKGVER@
 Architecture: any

commit c1b512e8767e86cb81890d18c0c456c122ce8329
Author: Jim Meyering <meyering at redhat.com>
Date:   Thu May 29 11:21:05 2008 +0200

    test for improved DOS-partition-table recognition
    
    * tests/t2200-dos-label-recog.sh: New file.
    * tests/Makefile.am (TESTS): Add t2200-dos-label-recog.sh.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 06fc397..3a694fe 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -5,6 +5,7 @@ TESTS = \
   t1100-busy-label.sh \
   t1500-small-ext2.sh \
   t2000-mkfs.sh \
+  t2200-dos-label-recog.sh \
   t3000-constraints.sh \
   t3100-resize-ext2-partion.sh \
   t5000-tags.sh
diff --git a/tests/t2200-dos-label-recog.sh b/tests/t2200-dos-label-recog.sh
new file mode 100755
index 0000000..d5d2670
--- /dev/null
+++ b/tests/t2200-dos-label-recog.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# Copyright (C) 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+test_description='improved MSDOS partition-table recognition'
+
+. ./init.sh
+
+######################################################################
+# With vestiges of a preceding FAT file system boot sector in the MBR,
+# parted 1.8.8.1.29 and earlier would fail to recognize a DOS
+# partition table.
+######################################################################
+N=100k
+dev=loop-file
+test_expect_success \
+    'create a file to simulate the underlying device' \
+    'dd if=/dev/null of=$dev bs=1 seek=$N 2> /dev/null'
+
+test_expect_success \
+    'label the test disk' \
+    'parted -s $dev mklabel msdos > out 2>&1'
+test_expect_success 'expect no output' '$compare out /dev/null'
+
+test_expect_success \
+    'create two partition' \
+    '
+    parted -s $dev mkpart primary  1s 40s > out 2>&1 &&
+    parted -s $dev mkpart primary 41s 80s > out 2>&1
+
+    '
+test_expect_success 'expect no output' '$compare out /dev/null'
+
+test_expect_success \
+    'write "FAT" where it would cause trouble' \
+    'printf FAT|dd bs=1c seek=82 count=3 of=$dev conv=notrunc'
+
+test_expect_success \
+    'print the partition table' \
+    '
+    parted -m -s $dev unit s p > out &&
+    tail -2 out > k && mv k out &&
+    printf "1:1s:40s:40s:::;\n2:41s:80s:40s:::;\n" > exp
+
+    '
+test_expect_success 'expect two partitions' '$compare out exp'
+
+test_done

commit e5eac66323dccaa189850d82396631d5bb721b1f
Author: Colin Watson <cjwatson at ubuntu.com>
Date:   Wed May 28 12:12:51 2008 +0100

    bug fix: improve DOS partition table recognition
    
    * libparted/labels/dos.c (msdos_probe): Make Parted's partition-table
    recognition code use the same technique that is used by the Linux
    kernel and by util-linux's fdisk.  I.e., accept it whenever all four
    boot indicators are 0 or 0x80, rather than using the FAT file system-
    recognizing heuristic.
    More analysis here:
      http://thread.gmane.org/gmane.comp.gnu.parted.devel/2142/focus=2154
    Reported by David Balažic here:
      https://bugs.launchpad.net/ubuntu/+source/parted/+bug/232175
      http://thread.gmane.org/gmane.comp.gnu.parted.devel/2142
    (cherry picked from commit d732a2b78255d62162fab57b552a3f069b53f33f)

diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c
index c686658..641257c 100644
--- a/libparted/labels/dos.c
+++ b/libparted/labels/dos.c
@@ -190,14 +190,16 @@ msdos_probe (const PedDevice *dev)
 	if (PED_LE16_TO_CPU (part_table->magic) != MSDOS_MAGIC)
 		goto probe_fail;
 
-	/* if this is a FAT fs, fail here.  Note that the Smart Boot Manager
-	 * Loader (SBML) signature indicates a partition table, not a file
-	 * system.
+	/* If this is a FAT fs, fail here.  Checking for the FAT signature
+	 * has some false positives; instead, do what the Linux kernel does
+	 * and ensure that each partition has a boot indicator that is
+	 * either 0 or 0x80.
 	 */
-	if ((!strncmp (part_table->boot_code + 0x36, "FAT", 3)
-	    && strncmp (part_table->boot_code + 0x40, "SBML", 4) != 0)
-	    || !strncmp (part_table->boot_code + 0x52, "FAT", 3))
-		goto probe_fail;
+	for (i = 0; i < 4; i++) {
+		if (part_table->partitions[i].boot_ind != 0
+		    && part_table->partitions[i].boot_ind != 0x80)
+			goto probe_fail;
+	}
 
 	/* If this is a GPT disk, fail here */
 	for (i = 0; i < 4; i++) {

commit 1572f22abcfb57bfb5006218920fce0fe2cf20d6
Author: Jim Meyering <meyering at redhat.com>
Date:   Fri May 23 15:58:20 2008 +0200

    avoid const-related compiler warnings
    
    * libparted/arch/linux.c (init_dasd, init_generic): Likewise.
    * libparted/exception.c (type_strings, option_strings): Likewise.
    (ped_exception_get_type_string, ped_exception_get_option_string):
    * libparted/fs/ext2/ext2_block_relocator.c (ext2_block_relocator_flush):
    * libparted/fs/ext2/ext2_mkfs.c (_set_dirent): Likewise.
    * libparted/fs/fat/resize.c (ask_type): Likewise.
    * libparted/fs/fat/traverse.c (fat_traverse_begin): Likewise.
    * libparted/fs/fat/traverse.h (buffer_size): Likewise.
    * libparted/labels/mac.c (_rawpart_cmp_type, _rawpart_cmp_name):
    (_rawpart_is_partition_map, _rawpart_is_boot, _rawpart_is_driver):
    (_rawpart_has_driver): Likewise.
    * parted/parted.c (options, options_help, number_msg): Likewise.
    (label_type_msg_start, flag_msg_start, unit_msg_start): Likewise.
    (part_type_msg, fs_type_msg_start, start_end_msg, state_msg): Likewise.
    (device_msg, name_msg, resize_msg_start, copyright_msg, do_print):
    * parted/ui.c (prog_name, banner_msg, usage_msg, bug_msg): Likewise.
    (screen_width): Likewise.
    * parted/ui.h (prog_name): Likewise.
    (cherry picked from commit 7863057791a7850f7319a9f035b5e9d79526ff93)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 6e7d010..9876956 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -986,7 +986,7 @@ error:
 }
 
 static int
-init_dasd (PedDevice* dev, char* model_name)
+init_dasd (PedDevice* dev, const char* model_name)
 {
         struct stat             dev_stat;
         struct hd_geometry      geo;
@@ -1042,7 +1042,7 @@ error:
 }
 
 static int
-init_generic (PedDevice* dev, char* model_name)
+init_generic (PedDevice* dev, const char* model_name)
 {
         struct stat             dev_stat;
         PedExceptionOption      ex_status;
diff --git a/libparted/exception.c b/libparted/exception.c
index 94d30cd..230a9b7 100644
--- a/libparted/exception.c
+++ b/libparted/exception.c
@@ -1,6 +1,6 @@
 /*
     libparted - a library for manipulating disk partitions
-    Copyright (C) 1999, 2000, 2007 Free Software Foundation, Inc.
+    Copyright (C) 1999, 2000, 2007-2008 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -73,7 +73,7 @@ static PedExceptionHandler*	ex_handler = default_handler;
 static PedException*		ex = NULL;
 static int			ex_fetch_count = 0;
 
-static char*	type_strings [] = {
+static const char *const type_strings [] = {
 	N_("Information"),
 	N_("Warning"),
 	N_("Error"),
@@ -82,7 +82,7 @@ static char*	type_strings [] = {
 	N_("No Implementation")
 };
 
-static char*	option_strings [] = {
+static const char *const option_strings [] = {
 	N_("Fix"),
 	N_("Yes"),
 	N_("No"),
@@ -98,7 +98,7 @@ static char*	option_strings [] = {
 char*
 ped_exception_get_type_string (PedExceptionType ex_type)
 {
-	return type_strings [ex_type - 1];
+	return (char *) type_strings [ex_type - 1];
 }
 
 /* FIXME: move this out to the prospective math.c */
@@ -121,7 +121,7 @@ ped_log2 (int n)
 char*
 ped_exception_get_option_string (PedExceptionOption ex_opt)
 {
-	return option_strings [ped_log2 (ex_opt)];
+	return (char *) option_strings [ped_log2 (ex_opt)];
 }
 
 static PedExceptionOption
diff --git a/libparted/fs/ext2/ext2_block_relocator.c b/libparted/fs/ext2/ext2_block_relocator.c
index b75a4c5..60f3d50 100644
--- a/libparted/fs/ext2/ext2_block_relocator.c
+++ b/libparted/fs/ext2/ext2_block_relocator.c
@@ -691,10 +691,11 @@ static int ext2_block_relocator_flush(struct ext2_fs *fs, struct ext2_block_relo
 		{
 			/* FIXXXME gross hack */
 			fprintf(stderr, "relocating %s blocks",
-				((char *[4]){"direct",
-						     "singly indirect",
-						     "doubly indirect",
-						     "triply indirect"})[i]);
+				((const char *const [4])
+				 {"direct",
+				  "singly indirect",
+				  "doubly indirect",
+				  "triply indirect"})[i]);
 			fflush(stderr);
 		}
 
diff --git a/libparted/fs/ext2/ext2_mkfs.c b/libparted/fs/ext2/ext2_mkfs.c
index 19931dd..b1a8ce3 100644
--- a/libparted/fs/ext2/ext2_mkfs.c
+++ b/libparted/fs/ext2/ext2_mkfs.c
@@ -1,6 +1,6 @@
 /*
     ext2_mkfs.c -- ext2 fs creator
-    Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc.
+    Copyright (C) 1999, 2000, 2001, 2007-2008 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -263,7 +263,7 @@ error:
 
 /* returns the offset into the buffer of the start of the next dir entry */
 static int _set_dirent(void* buf, int offset, int block_size, int is_last,
-		       uint32_t inode, char* name, int file_type)
+		       uint32_t inode, const char* name, int file_type)
 {
 	struct ext2_dir_entry_2 *dirent = (void*) (((char*)buf) + offset);
 	int name_len = strlen(name);
diff --git a/libparted/fs/fat/resize.c b/libparted/fs/fat/resize.c
index 7386948..5f24ec2 100644
--- a/libparted/fs/fat/resize.c
+++ b/libparted/fs/fat/resize.c
@@ -1,6 +1,6 @@
 /*
     libparted
-    Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
+    Copyright (C) 1998, 1999, 2000, 2007-2008 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -481,8 +481,8 @@ ask_type (PedFileSystem* fs, int fat16_ok, int fat32_ok, FatType* out_fat_type)
 {
 	FatSpecific*		fs_info = FAT_SPECIFIC (fs);
 	PedExceptionOption	status;
-	char*			fat16_msg;
-	char*			fat32_msg;
+	const char*		fat16_msg;
+	const char*		fat32_msg;
 
 	if (fs_info->fat_type == FAT_TYPE_FAT16)
 		fat16_msg = _("If you leave your file system as FAT16, "
diff --git a/libparted/fs/fat/traverse.c b/libparted/fs/fat/traverse.c
index 3d2e2b5..4ef2044 100644
--- a/libparted/fs/fat/traverse.c
+++ b/libparted/fs/fat/traverse.c
@@ -120,7 +120,7 @@ fat_traverse_mark_dirty (FatTraverseInfo* trav_info)
 
 FatTraverseInfo*
 fat_traverse_begin (PedFileSystem* fs, FatCluster start_cluster,
-		    char* dir_name)
+		    const char* dir_name)
 {
 	FatSpecific*		fs_info = FAT_SPECIFIC (fs);
 	FatTraverseInfo*	trav_info;
diff --git a/libparted/fs/fat/traverse.h b/libparted/fs/fat/traverse.h
index 21e4c27..afb24a5 100644
--- a/libparted/fs/fat/traverse.h
+++ b/libparted/fs/fat/traverse.h
@@ -42,7 +42,8 @@ extern int fat_traverse_entries_per_buffer (FatTraverseInfo* trav_info);
 /* starts traversal at an arbitary cluster.  if start_cluster==0, then uses
    root directory */
 extern FatTraverseInfo* fat_traverse_begin (PedFileSystem* fs,
-				     FatCluster start_cluster, char* dir_name);
+					    FatCluster start_cluster,
+					    const char* dir_name);
 
 extern int fat_traverse_complete (FatTraverseInfo* trav_info);
 
diff --git a/libparted/labels/mac.c b/libparted/labels/mac.c
index f014194..538e0c0 100644
--- a/libparted/labels/mac.c
+++ b/libparted/labels/mac.c
@@ -1,6 +1,6 @@
 /*
     libparted - a library for manipulating disk partitions
-    Copyright (C) 2000, 2002, 2004, 2007 Free Software Foundation, Inc.
+    Copyright (C) 2000, 2002, 2004, 2007-2008 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -376,19 +376,19 @@ mac_clobber (PedDevice* dev)
 #endif /* !DISCOVER_ONLY */
 
 static int
-_rawpart_cmp_type (MacRawPartition* raw_part, char* type)
+_rawpart_cmp_type (const MacRawPartition* raw_part, const char* type)
 {
 	return strncasecmp (raw_part->type, type, 32) == 0;
 }
 
 static int
-_rawpart_cmp_name (MacRawPartition* raw_part, char* name)
+_rawpart_cmp_name (const MacRawPartition* raw_part, const char* name)
 {
 	return strncasecmp (raw_part->name, name, 32) == 0;
 }
 
 static int
-_rawpart_is_partition_map (MacRawPartition* raw_part)
+_rawpart_is_partition_map (const MacRawPartition* raw_part)
 {
 	return _rawpart_cmp_type (raw_part, "Apple_partition_map");
 }
@@ -408,7 +408,7 @@ strncasestr (const char* haystack, const char* needle, int n)
 }
 
 static int
-_rawpart_is_boot (MacRawPartition* raw_part)
+_rawpart_is_boot (const MacRawPartition* raw_part)
 {
 	if (!strcasecmp(raw_part->type, "Apple_Bootstrap"))
 		return 1;
@@ -420,7 +420,7 @@ _rawpart_is_boot (MacRawPartition* raw_part)
 }
 
 static int
-_rawpart_is_driver (MacRawPartition* raw_part)
+_rawpart_is_driver (const MacRawPartition* raw_part)
 {
 	if (strncmp (raw_part->type, "Apple_", 6) != 0)
 		return 0;
@@ -430,7 +430,7 @@ _rawpart_is_driver (MacRawPartition* raw_part)
 }
 
 static int
-_rawpart_has_driver (MacRawPartition* raw_part, MacDiskData* mac_disk_data)
+_rawpart_has_driver (const MacRawPartition* raw_part, MacDiskData* mac_disk_data)
 {
 	MacDeviceDriver *driverlist;
 	uint16_t i, bsz;
diff --git a/parted/parted.c b/parted/parted.c
index d27a8e6..2afc2c1 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -79,7 +79,7 @@ typedef struct {
         time_t  predicted_time_left;
 } TimerContext;
 
-static struct option    options[] = {
+static const struct option const options[] = {
         /* name, has-arg, string-return-val, char-return-val */
         {"help",        0, NULL, 'h'},
         {"list",        0, NULL, 'l'},
@@ -90,7 +90,7 @@ static struct option    options[] = {
         {NULL,          0, NULL, 0}
 };
 
-static char*    options_help [][2] = {
+static const char *const options_help [][2] = {
         {"help",        N_("displays this help message")},
         {"list",        N_("lists partition layout on all block devices")},
         {"machine",     N_("displays machine parseable output")},
@@ -107,26 +107,26 @@ int     opt_machine_mode = 0;
 int     disk_is_modified = 0;
 int     is_toggle_mode = 0;
 
-static char* number_msg = N_(
+static const char* number_msg = N_(
 "NUMBER is the partition number used by Linux.  On MS-DOS disk labels, the "
 "primary partitions number from 1 to 4, logical partitions from 5 onwards.\n");
 
-static char* label_type_msg_start = N_("LABEL-TYPE is one of: ");
-static char* flag_msg_start =   N_("FLAG is one of: ");
-static char* unit_msg_start =   N_("UNIT is one of: ");
-static char* part_type_msg =    N_("PART-TYPE is one of: primary, logical, "
+static const char* label_type_msg_start = N_("LABEL-TYPE is one of: ");
+static const char* flag_msg_start =   N_("FLAG is one of: ");
+static const char* unit_msg_start =   N_("UNIT is one of: ");
+static const char* part_type_msg =    N_("PART-TYPE is one of: primary, logical, "
                                    "extended\n");
-static char* fs_type_msg_start = N_("FS-TYPE is one of: ");
-static char* start_end_msg =    N_("START and END are disk locations, such as "
+static const char* fs_type_msg_start = N_("FS-TYPE is one of: ");
+static const char* start_end_msg =    N_("START and END are disk locations, such as "
                 "4GB or 10%.  Negative values count from the end of the disk.  "
                 "For example, -1s specifies exactly the last sector.\n");
-static char* state_msg =        N_("STATE is one of: on, off\n");
-static char* device_msg =       N_("DEVICE is usually /dev/hda or /dev/sda\n");
-static char* name_msg =         N_("NAME is any word you want\n");
-static char* resize_msg_start = N_("The partition must have one of the "
+static const char* state_msg =        N_("STATE is one of: on, off\n");
+static const char* device_msg =       N_("DEVICE is usually /dev/hda or /dev/sda\n");
+static const char* name_msg =         N_("NAME is any word you want\n");
+static const char* resize_msg_start = N_("The partition must have one of the "
                                    "following FS-TYPEs: ");
 
-static char* copyright_msg = N_(
+static const char* copyright_msg = N_(
 "Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n"
 "This program is free software, covered by the GNU General Public License.\n"
 "\n"
@@ -1264,10 +1264,10 @@ do_print (PedDevice** dev)
         int             has_free_arg = 0;
         int             has_list_arg = 0;
         int             has_num_arg = 0;
-        char*           transport[14] = {"unknown", "scsi", "ide", "dac960",
-                                         "cpqarray", "file", "ataraid", "i2o",
-                                         "ubd", "dasd", "viodasd", "sx8", "dm",
-                                         "xvd"};
+        const char *const transport[14] = {"unknown", "scsi", "ide", "dac960",
+					   "cpqarray", "file", "ataraid", "i2o",
+					   "ubd", "dasd", "viodasd", "sx8", "dm",
+					   "xvd"};
         char*           peek_word;
         char*           start;
         char*           end;
diff --git a/parted/ui.c b/parted/ui.c
index 4a3f954..f854a54 100644
--- a/parted/ui.c
+++ b/parted/ui.c
@@ -154,17 +154,17 @@ struct siginfo_t {
 #  define ILL_BADSTK (INTMAX - 8)
 #endif
 
-char* prog_name = "GNU Parted " VERSION "\n";
+const char* prog_name = "GNU Parted " VERSION "\n";
 
-static char* banner_msg = N_(
+static const char* banner_msg = N_(
 "Welcome to GNU Parted! Type 'help' to view a list of commands.\n");
 
-static char* usage_msg = N_(
+static const char* usage_msg = N_(
 "Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]\n"
 "Apply COMMANDs with PARAMETERS to DEVICE.  If no COMMAND(s) are given, "
 "run in\ninteractive mode.\n");
 
-static char* bug_msg = N_(
+static const char* bug_msg = N_(
 "\n\nYou found a bug in GNU Parted! Here's what you have to do:\n\n"
 "Don't panic! The bug has most likely not affected any of your data.\n"
 "Help us to fix this bug by doing the following:\n\n"
@@ -218,7 +218,7 @@ screen_width ()
 
 /* HACK: don't specify termcap separately - it'll annoy the users. */
 #ifdef HAVE_LIBREADLINE
-        width = tgetnum ("co");
+        width = tgetnum ((char *) "co");
 #endif
 
         if (width <= 0)
diff --git a/parted/ui.h b/parted/ui.h
index f5cf760..77bb194 100644
--- a/parted/ui.h
+++ b/parted/ui.h
@@ -1,6 +1,6 @@
 /*
     parted - a frontend to libparted
-    Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc.
+    Copyright (C) 1999, 2000, 2001, 2007-2008 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
 
 #include "strlist.h"
 
-extern char*	prog_name;
+extern const char *prog_name;
 
 extern int init_ui ();
 extern int non_interactive_mode (PedDevice** dev, Command* cmd_list[],



More information about the Parted-commits mailing list